Documentation
¶
Index ¶
- Constants
- type AuthRequest
- func (a *AuthRequest) Authenticate(details UserDetails) error
- func (a AuthRequest) Done() bool
- func (a AuthRequest) GetACR() string
- func (a AuthRequest) GetAMR() []string
- func (a AuthRequest) GetAudience() []string
- func (a AuthRequest) GetAuthTime() time.Time
- func (a AuthRequest) GetClientID() string
- func (a AuthRequest) GetCodeChallenge() *oidc.CodeChallenge
- func (a AuthRequest) GetID() string
- func (a AuthRequest) GetNonce() string
- func (a AuthRequest) GetScopes() []string
- func (a AuthRequest) GetSubject() string
- type Client
- func (c Client) AccessTokenType() op.AccessTokenType
- func (c Client) ApplicationType() op.ApplicationType
- func (c Client) AuthMethod() oidc.AuthMethod
- func (c Client) ClockSkew() time.Duration
- func (c Client) DevMode() bool
- func (c Client) GetID() string
- func (c Client) GrantTypes() []oidc.GrantType
- func (c Client) IDTokenLifetime() time.Duration
- func (c Client) IDTokenUserinfoClaimsAssertion() bool
- func (c Client) IsScopeAllowed(scope string) bool
- func (c Client) LoginURL(authRequestID string) string
- func (c Client) PostLogoutRedirectURIs() []string
- func (c Client) RedirectURIs() []string
- func (c Client) ResponseTypes() []oidc.ResponseType
- func (c Client) RestrictAdditionalAccessTokenScopes() func(scopes []string) []string
- func (c Client) RestrictAdditionalIdTokenScopes() func(scopes []string) []string
- type ClientConfig
- type Config
- type PublicKey
- type Service
- type SigningKey
- type Storage
- func (o Storage) AuthRequestByCode(ctx context.Context, code string) (op.AuthRequest, error)
- func (o Storage) AuthRequestByID(ctx context.Context, id string) (op.AuthRequest, error)
- func (o Storage) AuthenticateUser(ctx context.Context, authRequestID string, user UserDetails) error
- func (o Storage) AuthorizeClientIDSecret(ctx context.Context, clientID, clientSecret string) error
- func (o Storage) CreateAccessAndRefreshTokens(ctx context.Context, request op.TokenRequest, currentRefreshToken string) (accessTokenID string, newRefreshTokenID string, expiration time.Time, ...)
- func (o Storage) CreateAccessToken(ctx context.Context, request op.TokenRequest) (accessTokenID string, expiration time.Time, err error)
- func (o Storage) CreateAuthRequest(ctx context.Context, request *oidc.AuthRequest, _ string) (op.AuthRequest, error)
- func (o Storage) DeleteAuthRequest(ctx context.Context, id string) error
- func (o Storage) GetClientByClientID(ctx context.Context, clientID string) (op.Client, error)
- func (o Storage) GetKeyByIDAndClientID(ctx context.Context, keyID, clientID string) (*jose.JSONWebKey, error)
- func (o Storage) GetPrivateClaimsFromScopes(ctx context.Context, userID, clientID string, scopes []string) (map[string]any, error)
- func (o Storage) GetRefreshTokenInfo(ctx context.Context, clientID string, token string) (userID string, tokenID string, err error)
- func (o Storage) Health(ctx context.Context) error
- func (o Storage) KeySet(ctx context.Context) ([]op.Key, error)
- func (o Storage) RevokeToken(ctx context.Context, tokenOrTokenID string, userID string, clientID string) *oidc.Error
- func (o Storage) SaveAuthCode(ctx context.Context, id string, code string) error
- func (o Storage) SetIntrospectionFromToken(ctx context.Context, userinfo *oidc.IntrospectionResponse, ...) error
- func (o Storage) SetUserinfoFromRequest(ctx context.Context, userinfo *oidc.UserInfo, request op.IDTokenRequest, ...) error
- func (o Storage) SetUserinfoFromScopes(ctx context.Context, userinfo *oidc.UserInfo, userID, clientID string, ...) error
- func (o Storage) SetUserinfoFromToken(ctx context.Context, userInfo *oidc.UserInfo, tokenID, subject, origin string) error
- func (o Storage) SignatureAlgorithms(ctx context.Context) ([]jose.SignatureAlgorithm, error)
- func (o Storage) SigningKey(ctx context.Context) (op.SigningKey, error)
- func (o Storage) TerminateSession(ctx context.Context, userID string, clientID string) error
- func (o Storage) TokenRequestByRefreshToken(ctx context.Context, refreshTokenID string) (op.RefreshTokenRequest, error)
- func (o Storage) ValidateJWTProfileScopes(ctx context.Context, userID string, scopes []string) ([]string, error)
- type Token
- type UserDetails
Constants ¶
View Source
const AuthRequestLifetime = 5 * time.Minute
View Source
const ClaimCondition = "condition"
View Source
const ClaimOrganizationIdentifier = "orgid"
View Source
const ClaimPatient = "patient"
View Source
const ClaimRoles = "roles"
View Source
const ScopePatient = "patient"
View Source
const TokenLifetime = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRequest ¶
type AuthRequest struct {
oidc.AuthRequest
ID string
User *UserDetails
AuthTime time.Time
AuthDone bool
Code string
ApplicationID string
ExpirationTime time.Time
}
func (*AuthRequest) Authenticate ¶
func (a *AuthRequest) Authenticate(details UserDetails) error
func (AuthRequest) Done ¶
func (a AuthRequest) Done() bool
func (AuthRequest) GetACR ¶
func (a AuthRequest) GetACR() string
func (AuthRequest) GetAMR ¶
func (a AuthRequest) GetAMR() []string
func (AuthRequest) GetAudience ¶
func (a AuthRequest) GetAudience() []string
func (AuthRequest) GetAuthTime ¶
func (a AuthRequest) GetAuthTime() time.Time
func (AuthRequest) GetClientID ¶
func (a AuthRequest) GetClientID() string
func (AuthRequest) GetCodeChallenge ¶
func (a AuthRequest) GetCodeChallenge() *oidc.CodeChallenge
func (AuthRequest) GetID ¶
func (a AuthRequest) GetID() string
func (AuthRequest) GetNonce ¶
func (a AuthRequest) GetNonce() string
func (AuthRequest) GetScopes ¶
func (a AuthRequest) GetScopes() []string
func (AuthRequest) GetSubject ¶
func (a AuthRequest) GetSubject() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AccessTokenType ¶
func (c Client) AccessTokenType() op.AccessTokenType
func (Client) ApplicationType ¶
func (c Client) ApplicationType() op.ApplicationType
func (Client) AuthMethod ¶
func (c Client) AuthMethod() oidc.AuthMethod
func (Client) GrantTypes ¶
func (Client) IDTokenLifetime ¶
func (Client) IDTokenUserinfoClaimsAssertion ¶
func (Client) IsScopeAllowed ¶
func (Client) PostLogoutRedirectURIs ¶
func (Client) RedirectURIs ¶
func (Client) ResponseTypes ¶
func (c Client) ResponseTypes() []oidc.ResponseType
func (Client) RestrictAdditionalAccessTokenScopes ¶
func (Client) RestrictAdditionalIdTokenScopes ¶
type ClientConfig ¶
type ClientConfig struct {
// ID holds the OAuth2 client_id of the registered client.
ID string `koanf:"id"`
// RedirectURI holds the URIs of the client to which the authorization server will redirect after authorization.
RedirectURI []string `koanf:"redirecturi"`
// Secret is the hex-encoded, SHA-256 hash of the client secret, salted with the client_id and concatenated with a pipe (|).
Secret string `koanf:"secret"`
}
type Config ¶
type Config struct {
Enabled bool `koanf:"enabled"`
Clients map[string]ClientConfig `koanf:"clients"`
}
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func (PublicKey) Algorithm ¶
func (p PublicKey) Algorithm() jose.SignatureAlgorithm
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) HandleLogin ¶
type SigningKey ¶
type SigningKey struct {
// contains filtered or unexported fields
}
func (SigningKey) ID ¶
func (s SigningKey) ID() string
func (SigningKey) Key ¶
func (s SigningKey) Key() any
func (SigningKey) Public ¶
func (p SigningKey) Public() PublicKey
func (SigningKey) SignatureAlgorithm ¶
func (s SigningKey) SignatureAlgorithm() jose.SignatureAlgorithm
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (Storage) AuthRequestByCode ¶
func (Storage) AuthRequestByID ¶
func (Storage) AuthenticateUser ¶
func (Storage) AuthorizeClientIDSecret ¶
func (Storage) CreateAccessAndRefreshTokens ¶
func (Storage) CreateAccessToken ¶
func (Storage) CreateAuthRequest ¶
func (o Storage) CreateAuthRequest(ctx context.Context, request *oidc.AuthRequest, _ string) (op.AuthRequest, error)
func (Storage) DeleteAuthRequest ¶
func (Storage) GetClientByClientID ¶
func (Storage) GetKeyByIDAndClientID ¶
func (Storage) GetPrivateClaimsFromScopes ¶
func (Storage) GetRefreshTokenInfo ¶
func (Storage) RevokeToken ¶
func (Storage) SaveAuthCode ¶
func (Storage) SetIntrospectionFromToken ¶
func (Storage) SetUserinfoFromRequest ¶
func (Storage) SetUserinfoFromScopes ¶
func (o Storage) SetUserinfoFromScopes(ctx context.Context, userinfo *oidc.UserInfo, userID, clientID string, scopes []string) error
SetUserinfoFromScopes sets the userinfo claims based on the requested scopes and user ID. Since we don't want to store the userinfo in the database, we just return nil here. User info should then be set through SetUserinfoFromRequest
func (Storage) SetUserinfoFromToken ¶
func (Storage) SignatureAlgorithms ¶
func (Storage) SigningKey ¶
func (Storage) TerminateSession ¶
func (Storage) TokenRequestByRefreshToken ¶
type UserDetails ¶
type UserDetails struct {
ID string
Name string
Email string
Roles []string
Organization fhir.Organization
Condition fhir.Condition
PatientIdentifiers []fhir.Identifier
}
Click to show internal directories.
Click to hide internal directories.