Documentation ¶
Index ¶
- func NewAccessTokenCredentials(accessToken string, opts ...credentials.AccessTokenCredentialsOption) *credentials.AccessToken
- func NewAnonymousCredentials(opts ...credentials.AnonymousCredentialsOption) *credentials.Anonymous
- func NewFixedTokenSource(token, tokenType string) credentials.TokenSource
- func NewJWTTokenSource(opts ...credentials.JWTTokenSourceOption) (credentials.TokenSource, error)
- func NewStaticCredentials(user, password, authEndpoint string, ...) *credentials.Static
- func WithAudience(audience ...string) oauthCredentialsAndJWTCredentialsOption
- func WithGrpcDialOptions(opts ...grpc.DialOption) credentials.StaticCredentialsOption
- func WithID(id string) credentials.JWTTokenSourceOption
- func WithIssuer(issuer string) credentials.JWTTokenSourceOption
- func WithKeyID(id string) credentials.JWTTokenSourceOption
- func WithPrivateKey(key interface{}) credentials.JWTTokenSourceOption
- func WithRSAPrivateKeyPEMContent(key []byte) credentials.JWTTokenSourceOption
- func WithRSAPrivateKeyPEMFile(path string) credentials.JWTTokenSourceOption
- func WithSigningMethod(method jwt.SigningMethod) credentials.JWTTokenSourceOption
- func WithSourceInfo(sourceInfo string) credentials.SourceInfoOption
- func WithSubject(subject string) credentials.JWTTokenSourceOption
- func WithTokenTTL(ttl time.Duration) credentials.JWTTokenSourceOption
- type Credentials
- type Oauth2TokenExchangeCredentialsOption
- func WithActorToken(actorToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption
- func WithFixedActorToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption
- func WithFixedSubjectToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption
- func WithGrantType(grantType string) Oauth2TokenExchangeCredentialsOption
- func WithJWTActorToken(opts ...credentials.JWTTokenSourceOption) Oauth2TokenExchangeCredentialsOption
- func WithJWTSubjectToken(opts ...credentials.JWTTokenSourceOption) Oauth2TokenExchangeCredentialsOption
- func WithRequestTimeout(timeout time.Duration) Oauth2TokenExchangeCredentialsOption
- func WithRequestedTokenType(requestedTokenType string) Oauth2TokenExchangeCredentialsOption
- func WithResource(resource string) Oauth2TokenExchangeCredentialsOption
- func WithScope(scope ...string) Oauth2TokenExchangeCredentialsOption
- func WithSubjectToken(subjectToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption
- func WithTokenEndpoint(endpoint string) Oauth2TokenExchangeCredentialsOption
- type Token
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccessTokenCredentials ¶ added in v3.5.0
func NewAccessTokenCredentials( accessToken string, opts ...credentials.AccessTokenCredentialsOption, ) *credentials.AccessToken
NewAccessTokenCredentials makes access token credentials object Passed options redefines default values of credentials object internal fields
func NewAnonymousCredentials ¶ added in v3.5.0
func NewAnonymousCredentials( opts ...credentials.AnonymousCredentialsOption, ) *credentials.Anonymous
NewAnonymousCredentials makes anonymous credentials object Passed options redefines default values of credentials object internal fields
func NewFixedTokenSource ¶ added in v3.65.0
func NewFixedTokenSource(token, tokenType string) credentials.TokenSource
NewFixedTokenSource makes fixed token source for OAuth 2.0 token exchange credentials
func NewJWTTokenSource ¶ added in v3.65.0
func NewJWTTokenSource(opts ...credentials.JWTTokenSourceOption) (credentials.TokenSource, error)
NewJWTTokenSource makes JWT token source for OAuth 2.0 token exchange credentials
func NewStaticCredentials ¶ added in v3.42.3
func NewStaticCredentials( user, password, authEndpoint string, opts ...credentials.StaticCredentialsOption, ) *credentials.Static
NewStaticCredentials makes static credentials object
func WithAudience ¶ added in v3.65.0
func WithAudience(audience ...string) oauthCredentialsAndJWTCredentialsOption
func WithGrpcDialOptions ¶ added in v3.53.3
func WithGrpcDialOptions(opts ...grpc.DialOption) credentials.StaticCredentialsOption
WithGrpcDialOptions option append to static credentials object GRPC dial options
func WithIssuer ¶ added in v3.65.0
func WithIssuer(issuer string) credentials.JWTTokenSourceOption
Issuer
func WithPrivateKey ¶ added in v3.65.0
func WithPrivateKey(key interface{}) credentials.JWTTokenSourceOption
PrivateKey
func WithRSAPrivateKeyPEMContent ¶ added in v3.65.0
func WithRSAPrivateKeyPEMContent(key []byte) credentials.JWTTokenSourceOption
PrivateKey
func WithRSAPrivateKeyPEMFile ¶ added in v3.65.0
func WithRSAPrivateKeyPEMFile(path string) credentials.JWTTokenSourceOption
PrivateKey
func WithSigningMethod ¶ added in v3.65.0
func WithSigningMethod(method jwt.SigningMethod) credentials.JWTTokenSourceOption
SigningMethod
func WithSourceInfo ¶ added in v3.5.0
func WithSourceInfo(sourceInfo string) credentials.SourceInfoOption
WithSourceInfo option append to credentials object the source info for reporting source info details on error case
func WithSubject ¶ added in v3.65.0
func WithSubject(subject string) credentials.JWTTokenSourceOption
Subject
func WithTokenTTL ¶ added in v3.65.0
func WithTokenTTL(ttl time.Duration) credentials.JWTTokenSourceOption
TokenTTL
Types ¶
type Credentials ¶
type Credentials interface { // Token must return actual token or error Token(ctx context.Context) (string, error) }
Credentials is an interface of YDB credentials required for connect with YDB
func NewOauth2TokenExchangeCredentials ¶ added in v3.65.0
func NewOauth2TokenExchangeCredentials( opts ...credentials.Oauth2TokenExchangeCredentialsOption, ) (Credentials, error)
NewOauth2TokenExchangeCredentials makes OAuth 2.0 token exchange protocol credentials object https://www.rfc-editor.org/rfc/rfc8693
type Oauth2TokenExchangeCredentialsOption ¶ added in v3.65.0
type Oauth2TokenExchangeCredentialsOption = credentials.Oauth2TokenExchangeCredentialsOption
func WithActorToken ¶ added in v3.65.0
func WithActorToken(actorToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption
ActorTokenSource
func WithFixedActorToken ¶ added in v3.65.0
func WithFixedActorToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption
ActorTokenSource
func WithFixedSubjectToken ¶ added in v3.65.0
func WithFixedSubjectToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption
SubjectTokenSource
func WithGrantType ¶ added in v3.65.0
func WithGrantType(grantType string) Oauth2TokenExchangeCredentialsOption
GrantType
func WithJWTActorToken ¶ added in v3.65.0
func WithJWTActorToken(opts ...credentials.JWTTokenSourceOption) Oauth2TokenExchangeCredentialsOption
ActorTokenSource
func WithJWTSubjectToken ¶ added in v3.65.0
func WithJWTSubjectToken(opts ...credentials.JWTTokenSourceOption) Oauth2TokenExchangeCredentialsOption
SubjectTokenSource
func WithRequestTimeout ¶ added in v3.65.0
func WithRequestTimeout(timeout time.Duration) Oauth2TokenExchangeCredentialsOption
RequestTimeout
func WithRequestedTokenType ¶ added in v3.65.0
func WithRequestedTokenType(requestedTokenType string) Oauth2TokenExchangeCredentialsOption
RequestedTokenType
func WithResource ¶ added in v3.65.0
func WithResource(resource string) Oauth2TokenExchangeCredentialsOption
Resource
func WithScope ¶ added in v3.65.0
func WithScope(scope ...string) Oauth2TokenExchangeCredentialsOption
Scope
func WithSubjectToken ¶ added in v3.65.0
func WithSubjectToken(subjectToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption
SubjectTokenSource
func WithTokenEndpoint ¶ added in v3.65.0
func WithTokenEndpoint(endpoint string) Oauth2TokenExchangeCredentialsOption
TokenEndpoint
type Token ¶ added in v3.65.0
type Token = credentials.Token
type TokenSource ¶ added in v3.65.0
type TokenSource = credentials.TokenSource