Documentation ¶
Index ¶
- Variables
- func Use()
- func WithNonEmptyURLValues(mappedValues map[string][]string) url.Values
- type AuthClientOption
- type AuthClientOptions
- type AuthOption
- type AuthOptions
- func WithAccessToken(accessToken string) AuthOptions
- func WithAuthentication(auth security.Authentication) AuthOptions
- func WithClientAuth(clientID, secret string) AuthOptions
- func WithCredentials(username, password string) AuthOptions
- func WithCurrentSecurity(ctx context.Context) AuthOptions
- func WithScopes(scopes ...string) AuthOptions
- func WithTenant(tenantId string, tenantExternalId string) AuthOptions
- func WithTenantExternalId(tenantExternalId string) AuthOptions
- func WithTenantId(tenantId string) AuthOptions
- func WithUser(userId string, username string) AuthOptions
- func WithUserId(userId string) AuthOptions
- func WithUsername(username string) AuthOptions
- type AuthenticationClient
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = &bootstrap.Module{ Name: "auth-client", Precedence: bootstrap.SecurityIntegrationPrecedence, Options: []fx.Option{ appconfig.FxEmbeddedDefaults(securityint.DefaultConfigFS), fx.Provide(securityint.BindSecurityIntegrationProperties), fx.Provide(provideAuthClient), }, }
Functions ¶
func WithNonEmptyURLValues ¶
WithNonEmptyURLValues will accept a map[key][values] and convert it to a url.Values. The function will check that the values, typed []string has a length > 0. Otherwise, will not insert the key into the url.Values
Types ¶
type AuthClientOption ¶
type AuthClientOptions ¶
type AuthClientOptions func(opt *AuthClientOption)
type AuthOption ¶
type AuthOption struct { Password string // Password is used by password login AccessToken string // AccessToken is used by switch user/tenant Username string // Username is used by password login and switch user UserId string // UserId is used by switch user TenantId string // TenantId is used by password login and switch user/tenant TenantExternalId string // TenantExternalId is used by password login and switch user/tenant Scopes []string // OAuth Scopes option ClientID string // ClientID that is used for the client credentials auth flow ClientSecret string // ClientSecret that is used for the client credentials auth flow }
type AuthOptions ¶
type AuthOptions func(opt *AuthOption)
func WithAccessToken ¶
func WithAccessToken(accessToken string) AuthOptions
func WithAuthentication ¶
func WithAuthentication(auth security.Authentication) AuthOptions
func WithClientAuth ¶
func WithClientAuth(clientID, secret string) AuthOptions
func WithCredentials ¶
func WithCredentials(username, password string) AuthOptions
func WithCurrentSecurity ¶
func WithCurrentSecurity(ctx context.Context) AuthOptions
func WithScopes ¶ added in v0.14.0
func WithScopes(scopes ...string) AuthOptions
func WithTenant ¶
func WithTenant(tenantId string, tenantExternalId string) AuthOptions
WithTenant create an options that specify tenant by either tenantId or tenantExternalId username and userId are exclusive, cannot be both empty
func WithTenantExternalId ¶
func WithTenantExternalId(tenantExternalId string) AuthOptions
func WithTenantId ¶
func WithTenantId(tenantId string) AuthOptions
func WithUser ¶
func WithUser(userId string, username string) AuthOptions
WithUser create an options that specify user by either username or userId username and userId are exclusive, cannot be both empty
func WithUserId ¶
func WithUserId(userId string) AuthOptions
func WithUsername ¶
func WithUsername(username string) AuthOptions
type AuthenticationClient ¶
type AuthenticationClient interface { PasswordLogin(ctx context.Context, opts ...AuthOptions) (*Result, error) ClientCredentials(ctx context.Context, opts ...AuthOptions) (*Result, error) SwitchUser(ctx context.Context, opts ...AuthOptions) (*Result, error) SwitchTenant(ctx context.Context, opts ...AuthOptions) (*Result, error) }
func NewRemoteAuthClient ¶
func NewRemoteAuthClient(opts ...AuthClientOptions) (AuthenticationClient, error)
type Result ¶
type Result struct {
Token oauth2.AccessToken
}
Click to show internal directories.
Click to hide internal directories.