Skip to content

Commit

Permalink
refactor(sdk): OAuth2 SDK API
Browse files Browse the repository at this point in the history
BREAKING CHANGE: SDK naming has changed for the following operations:

```patch
ory.
-   V0alpha2Api.AdminDeleteOAuth2Token(context.Background()).
+   OAuth2Api.DeleteOAuth2Token(context.Background()).
    ClientId("foobar").Execute()

ory.
-   V0alpha2Api.RevokeOAuth2Token(
+   OAuth2Api.RevokeOAuth2Token(
        context.WithValue(context.Background(), sdk.ContextBasicAuth, sdk.BasicAuth{
            UserName: clientID,
            Password: clientSecret,
        })).Token(token).Execute()

ory.
-   V0alpha2Api.AdminIntrospectOAuth2Token(context.Background()).
+   OAuth2Api.IntrospectOAuth2Token(context.Background()).
    Token(token).
    Scope("foo bar")).Execute()
```
  • Loading branch information
aeneasr committed Oct 11, 2022
1 parent b0a2b05 commit 142b55f
Show file tree
Hide file tree
Showing 25 changed files with 2,180 additions and 2,102 deletions.
2 changes: 1 addition & 1 deletion cmd/cmd_delete_tokens.go
Expand Up @@ -40,7 +40,7 @@ func NewDeleteAccessTokensCmd() *cobra.Command {
}

clientID := args[0]
_, err = client.V0alpha2Api.AdminDeleteOAuth2Token(cmd.Context()).ClientId(clientID).Execute() //nolint:bodyclose
_, err = client.OAuth2Api.DeleteOAuth2Token(cmd.Context()).ClientId(clientID).Execute() //nolint:bodyclose
if err != nil {
return cmdx.PrintOpenAPIError(cmd, err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd_introspect_token.go
Expand Up @@ -42,7 +42,7 @@ func NewIntrospectTokenCmd() *cobra.Command {
return err
}

result, _, err := client.V0alpha2Api.AdminIntrospectOAuth2Token(cmd.Context()).
result, _, err := client.OAuth2Api.IntrospectOAuth2Token(cmd.Context()).
Token(args[0]).
Scope(strings.Join(flagx.MustGetStringSlice(cmd, "scope"), " ")).Execute() //nolint:bodyclose
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd_revoke_token.go
Expand Up @@ -55,7 +55,7 @@ Please provide a Client ID and Client Secret using flags --client-id and --clien
}

token := args[0]
_, err = client.V0alpha2Api.RevokeOAuth2Token(
_, err = client.OAuth2Api.RevokeOAuth2Token(
context.WithValue(cmd.Context(), hydra.ContextBasicAuth, hydra.BasicAuth{
UserName: clientID,
Password: clientSecret,
Expand Down
4 changes: 2 additions & 2 deletions internal/httpclient/.openapi-generator/FILES
Expand Up @@ -41,7 +41,7 @@ docs/OAuth2ConsentSessionExpiresAt.md
docs/OAuth2LoginRequest.md
docs/OAuth2LogoutRequest.md
docs/OAuth2RedirectTo.md
docs/OAuth2TokenResponse.md
docs/OAuth2TokenExchange.md
docs/OidcApi.md
docs/OidcConfiguration.md
docs/OidcUserInfo.md
Expand Down Expand Up @@ -90,7 +90,7 @@ model_o_auth2_consent_session_expires_at.go
model_o_auth2_login_request.go
model_o_auth2_logout_request.go
model_o_auth2_redirect_to.go
model_o_auth2_token_response.go
model_o_auth2_token_exchange.go
model_oidc_configuration.go
model_oidc_user_info.go
model_pagination.go
Expand Down
98 changes: 49 additions & 49 deletions internal/httpclient/README.md

Large diffs are not rendered by default.

0 comments on commit 142b55f

Please sign in to comment.