Documentation
¶
Overview ¶
Package manager contains an identity manager responsible for refreshing sessions and creating users.
Index ¶
- func FromOAuthToken(token *session.OAuthToken) *oauth2.Token
- func ToOAuthToken(token *oauth2.Token) *session.OAuthToken
- type Authenticator
- type Manager
- type Option
- func WithAuthenticator(authenticator Authenticator) Option
- func WithDataBrokerClient(dataBrokerClient databroker.DataBrokerServiceClient) Option
- func WithDirectoryProvider(directoryProvider directory.Provider) Option
- func WithGroupRefreshInterval(interval time.Duration) Option
- func WithGroupRefreshTimeout(timeout time.Duration) Option
- func WithSessionRefreshCoolOffDuration(dur time.Duration) Option
- func WithSessionRefreshGracePeriod(dur time.Duration) Option
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromOAuthToken ¶
func FromOAuthToken(token *session.OAuthToken) *oauth2.Token
FromOAuthToken converts a session oauth token to oauth2.Token.
func ToOAuthToken ¶
func ToOAuthToken(token *oauth2.Token) *session.OAuthToken
ToOAuthToken converts an oauth2.Token to a session oauth token.
Types ¶
type Authenticator ¶
type Authenticator interface { Refresh(context.Context, *oauth2.Token, identity.State) (*oauth2.Token, error) Revoke(context.Context, *oauth2.Token) error UpdateUserInfo(context.Context, *oauth2.Token, interface{}) error }
Authenticator is an identity.Provider with only the methods needed by the manager.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager refreshes identity information using session and user data.
func (*Manager) Run ¶
Run runs the manager. This method blocks until an error occurs or the given context is canceled.
func (*Manager) UpdateConfig ¶ added in v0.11.0
UpdateConfig updates the manager with the new options.
type Option ¶
type Option func(*config)
An Option customizes the configuration used for the identity manager.
func WithAuthenticator ¶ added in v0.11.0
func WithAuthenticator(authenticator Authenticator) Option
WithAuthenticator sets the authenticator in the config.
func WithDataBrokerClient ¶ added in v0.11.0
func WithDataBrokerClient(dataBrokerClient databroker.DataBrokerServiceClient) Option
WithDataBrokerClient sets the databroker client in the config.
func WithDirectoryProvider ¶ added in v0.11.0
WithDirectoryProvider sets the directory provider in the config.
func WithGroupRefreshInterval ¶
WithGroupRefreshInterval sets the group refresh interval used by the manager.
func WithGroupRefreshTimeout ¶
WithGroupRefreshTimeout sets the group refresh timeout used by the manager.
func WithSessionRefreshCoolOffDuration ¶
WithSessionRefreshCoolOffDuration sets the session refresh cool-off duration used by the manager.
func WithSessionRefreshGracePeriod ¶
WithSessionRefreshGracePeriod sets the session refresh grace period used by the manager.
type Session ¶
A Session is a session managed by the Manager.
func (Session) NextRefresh ¶
NextRefresh returns the next time the session needs to be refreshed.
func (*Session) UnmarshalJSON ¶
UnmarshalJSON unmarshals json data into the session object.
type User ¶
A User is a user managed by the Manager.
func (User) NextRefresh ¶
NextRefresh returns the next time the user information needs to be refreshed.
func (*User) UnmarshalJSON ¶
UnmarshalJSON unmarshals json data into the user object.