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

feat(core): types #2

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions core/type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package core

type OidcConfigResponse struct {
AuthorizationEndpoint string `json:"authorization_endpoint"`
TokenEndpoint string `json:"token_endpoint"`
EndSessionEndpoint string `json:"end_session_endpoint"`
RevocationEndpoint string `json:"revocation_endpoint"`
JwksUri string `json:"jwks_uri"`
Issuer string `json:"issuer"`
}

type CodeTokenResponse struct {
AccessToken string `json:"access_token"`
xiaoyijun marked this conversation as resolved.
Show resolved Hide resolved
RefreshToken string `json:"refresh_token"`
IdToken string `json:"id_token"`
Scope string `json:"scope"`
ExpireIn int `json:"expires_in"`
}

type RefreshTokenResponse = CodeTokenResponse

type IdTokenClaims struct {
Sub string `json:"sub"`
Aud string `json:"aud"`
Exp int `json:"exp"`
Iat int `json:"iat"`
Iss string `json:"iss"`
AtHash string `json:"at_hash"`
Username string `json:"username"`
Name string `json:"name"`
Avatar string `json:"avatar"`
RoleNames []string `json:"role_names"`
}