Documentation
¶
Index ¶
- Constants
- func NewRequestError(statusCode int, message string) error
- type Account
- type AuthorizeOAuth2ClientRequest
- type DeleteOAuth2ClientRequest
- type IntrospectOAuth2TokenRequest
- type IntrospectRequestData
- type LoginRequestData
- type NewOAuthClientRequest
- type OAuthAuthorizationCode
- type OAuthClient
- type OAuthRevokeTokenRequest
- type OAuthTokenRequest
- type OTPRequest
- type Password
- type RegisterRequestData
- type RequestError
- type RequestErrorInterface
- type Token
- type UpdateOAuth2ClientKeyValueRequest
Constants ¶
View Source
const ( AuthorizationCodeGrant string = "authorization_code" ImplicitGrant string = "implicit" PasswordGrant string = "password" ClientCredentialsGrant string = "client_credentials" )
View Source
const ( OAuthApplicationStatusActive string = "active" OAuthApplicationStatusDisabled string = "disabled" OAuthApplicationStatusSuspended string = "suspended" )
Variables ¶
This section is empty.
Functions ¶
func NewRequestError ¶
Types ¶
type Account ¶
type Account struct { Id edgedb.UUID `edgedb:"id"` Username string `edgedb:"username"` Email string `edgedb:"email"` AvatarURI string `edgedb:"avatar_uri"` Status string `edgedb:"status"` OtpSecret edgedb.OptionalStr `edgedb:"otp_secret"` OtpState string `edgedb:"otp_state"` StatusDescription string `edgedb:"status_description"` StatusChanged time.Time `edgedb:"status_changed"` CreatedAt time.Time `edgedb:"created_at"` }
type AuthorizeOAuth2ClientRequest ¶
type AuthorizeOAuth2ClientRequest struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` ResponseType string `json:"response_type"` RedirectURI string `json:"redirect_uri"` Scope string `json:"scope"` State string `json:"state"` CodeChallenge string `json:"code_challenge"` CodeChallengeMethod string `json:"code_challenge_method"` UserID string `json:"user_id"` }
func (*AuthorizeOAuth2ClientRequest) Validate ¶
func (r *AuthorizeOAuth2ClientRequest) Validate() map[string]string
type DeleteOAuth2ClientRequest ¶
type DeleteOAuth2ClientRequest struct {
ClientID string `json:"client_id"`
}
func (*DeleteOAuth2ClientRequest) Validate ¶
func (r *DeleteOAuth2ClientRequest) Validate() map[string]string
type IntrospectOAuth2TokenRequest ¶
type IntrospectOAuth2TokenRequest struct { Token string `json:"token"` CheckIfTokenIsRevoked bool `json:"check_if_token_is_revoked"` }
func (*IntrospectOAuth2TokenRequest) Validate ¶
func (r *IntrospectOAuth2TokenRequest) Validate() map[string]string
type IntrospectRequestData ¶
type IntrospectRequestData struct {
Token string `json:"token"`
}
func (*IntrospectRequestData) Validate ¶
func (r *IntrospectRequestData) Validate() map[string]string
type LoginRequestData ¶
type LoginRequestData struct { Email string `json:"email"` Password string `json:"password"` ClientId string `json:"client_id"` RedirectUri string `json:"redirect_uri"` Scope string `json:"scope"` OTP string `json:"otp"` }
func (*LoginRequestData) Validate ¶
func (r *LoginRequestData) Validate() map[string]string
type NewOAuthClientRequest ¶
type NewOAuthClientRequest struct { ClientName string `json:"client_name"` ClientType string `json:"client_type"` RedirectUris []string `json:"redirect_uris"` GrantTypes []string `json:"grant_types"` Scope []string `json:"scope"` ClientOwner edgedb.UUID `json:"client_owner"` ClientDescription string `json:"client_description"` ClientHomepageUrl string `json:"client_homepage_url"` ClientLogoUrl string `json:"client_logo_url"` ClientTosUrl string `json:"client_tos_url"` ClientPrivacyUrl string `json:"client_privacy_url"` }
func (*NewOAuthClientRequest) Validate ¶
func (r *NewOAuthClientRequest) Validate() map[string]string
type OAuthAuthorizationCode ¶
type OAuthAuthorizationCode struct { Id edgedb.UUID `edgedb:"id"` Code string `edgedb:"code"` Consented bool `edgedb:"consented"` ExpiresAt time.Time `edgedb:"expires_at"` GrantedScope []string `edgedb:"granted_scope"` RequestedScope []string `edgedb:"requested_scope"` Account Account `edgedb:"account"` Application OAuthClient `edgedb:"application"` RedirectURI string `edgedb:"redirect_uri"` }
type OAuthClient ¶
type OAuthClient struct { ID edgedb.UUID `json:"id" edgedb:"id"` ClientID string `json:"client_id" edgedb:"client_id"` ClientSecret string `json:"client_secret" edgedb:"client_secret"` ClientName string `json:"client_name" edgedb:"client_name"` ClientType string `json:"client_type" edgedb:"client_type"` RedirectURIs []string `json:"redirect_uris" edgedb:"redirect_uris"` GrantTypes []string `json:"grant_types" edgedb:"grant_types"` Scope []string `json:"scope" edgedb:"scope"` ClientOwner Account `json:"client_owner" edgedb:"client_owner"` ClientDescription edgedb.OptionalStr `json:"client_description" edgedb:"client_description"` ClientHomepageUrl edgedb.OptionalStr `json:"client_homepage_url" edgedb:"client_homepage_url"` ClientLogoUrl edgedb.OptionalStr `json:"client_logo_url" edgedb:"client_logo_url"` ClientTosUrl edgedb.OptionalStr `json:"client_tos_url" edgedb:"client_tos_url"` ClientPrivacyUrl edgedb.OptionalStr `json:"client_privacy_url" edgedb:"client_privacy_url"` ClientRegistrationDate time.Time `json:"client_registration_date" edgedb:"client_registration_date"` ClientStatus string `json:"client_status" edgedb:"client_status"` ClientRateLimits []byte `json:"client_rate_limits" edgedb:"client_rate_limits"` }
type OAuthRevokeTokenRequest ¶
type OAuthRevokeTokenRequest struct {
Token string `json:"token"`
}
func (*OAuthRevokeTokenRequest) Validate ¶
func (r *OAuthRevokeTokenRequest) Validate() map[string]string
type OAuthTokenRequest ¶
type OAuthTokenRequest struct { GrantType string `json:"grant_type"` Code string `json:"code"` RedirectURI string `json:"redirect_uri"` RefreshToken string `json:"refresh_token"` }
func (*OAuthTokenRequest) Validate ¶
func (r *OAuthTokenRequest) Validate() map[string]string
type OTPRequest ¶
func (*OTPRequest) Validate ¶
func (r *OTPRequest) Validate() map[string]string
type Password ¶
type Password struct { Id edgedb.UUID `edgedb:"id"` Account Account `edgedb:"account"` Email string `edgedb:"email"` Password string `edgedb:"password"` LastUsed time.Time `edgedb:"last_used"` FailedAttempts int16 `edgedb:"failed_attempts"` LastFailedAttempt time.Time `edgedb:"last_failed_attempt"` }
type RegisterRequestData ¶
type RegisterRequestData struct { Email string `json:"email"` Username string `json:"username"` Password string `json:"password"` ClientId string `json:"client_id"` RedirectUri string `json:"redirect_uri"` }
func (*RegisterRequestData) Validate ¶
func (r *RegisterRequestData) Validate() map[string]string
type RequestError ¶
type RequestError struct {
// contains filtered or unexported fields
}
func (*RequestError) Error ¶
func (e *RequestError) Error() string
func (*RequestError) StatusCode ¶
func (e *RequestError) StatusCode() int
type RequestErrorInterface ¶
type Token ¶
type Token struct { ID edgedb.UUID `json:"id" edgedb:"id"` Variant string `json:"variant" edgedb:"variant"` Value string `json:"value" edgedb:"value"` Scope []string `json:"scope" edgedb:"scope"` Account Account `json:"account" edgedb:"account"` Revoked bool `json:"revoked" edgedb:"revoked"` ExpiresAt time.Time `json:"expires_at" edgedb:"expires_at"` }
type UpdateOAuth2ClientKeyValueRequest ¶
type UpdateOAuth2ClientKeyValueRequest struct { ClientID string `json:"client_id"` Key string `json:"key"` Value string `json:"value"` }
func (*UpdateOAuth2ClientKeyValueRequest) GetKeyType ¶
func (r *UpdateOAuth2ClientKeyValueRequest) GetKeyType() (string, error)
func (*UpdateOAuth2ClientKeyValueRequest) Validate ¶
func (r *UpdateOAuth2ClientKeyValueRequest) Validate() map[string]string
Click to show internal directories.
Click to hide internal directories.