Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTOR-5225 Add callbacks to save application state for OAuth2 #3282

Merged
merged 1 commit into from Dec 2, 2022

Conversation

rsinukov
Copy link
Contributor

@rsinukov rsinukov commented Dec 1, 2022

@rsinukov rsinukov requested a review from e5l December 1, 2022 22:24
@rsinukov rsinukov self-assigned this Dec 1, 2022
val extraParameters: Parameters = Parameters.Empty,
) : OAuthAccessTokenResponse() {

public var state: String? = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question: is it expected, that while OAuth2 is data class this new property will not appear in copy/componentN/equals/hashCode?

Copy link
Contributor Author

@rsinukov rsinukov Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really difficult to add it without breaking binary compatibility. In practice, I don't expect users to do copy/componentN on principals. And for equals and hashcode, having accessToken there should be enough.

@@ -117,6 +118,40 @@ public sealed class OAuthServerSettings(public val name: String, public val vers
emptyList(),
accessTokenInterceptor
)

@Deprecated("This constructor will be removed", level = DeprecationLevel.HIDDEN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: "This constructor will be removed" -> "Binary compatibility with 2.x"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, deprecation messages should be for users explaining why this is deprecated, not for us explaining why it is kept.

Copy link
Contributor

@whyoleg whyoleg Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, declarations with level=HIDDEN will be not visible to user, until they open source code. They even should not feel this change at all, as new parameter has default value, but ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but for consistency, I prefer it this way.

Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rsinukov rsinukov merged commit 9e12c15 into main Dec 2, 2022
@rsinukov rsinukov deleted the rsinukov/oauth-state branch December 2, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants