Documentation ¶
Index ¶
Constants ¶
const (
ZitadelKeyPath = "ZITADEL_KEY_PATH"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthInterceptor ¶
type AuthInterceptor struct {
oauth2.TokenSource
}
func NewAuthInterceptor
deprecated
func NewAuthInterceptor(issuer, keyPath string, scopes ...string) (*AuthInterceptor, error)
NewAuthInterceptor creates an interceptor which authenticates a service account with JWT Profile using a key.json. There returned token will be used for authorization in all calls if expired, the token will be automatically refreshed
Deprecated: use NewAuthenticator(issuer, JWTProfileFromPath(keyPath), scopes...) instead
func NewAuthenticator ¶
func NewAuthenticator(issuer string, jwtProfileTokenSource JWTProfileTokenSource, scopes ...string) (*AuthInterceptor, error)
NewAuthenticator creates an interceptor which authenticates a service account with a provided JWT Profile (using a key.json either as file or data). There returned token will be used for authorization in all calls if expired, the token will be automatically refreshed
func (*AuthInterceptor) Stream ¶
func (interceptor *AuthInterceptor) Stream() grpc.StreamClientInterceptor
func (*AuthInterceptor) Unary ¶
func (interceptor *AuthInterceptor) Unary() grpc.UnaryClientInterceptor
type JWTProfileTokenSource ¶
type JWTProfileTokenSource func(issuer string, scopes []string) (oauth2.TokenSource, error)
func JWTProfileFromFileData ¶
func JWTProfileFromFileData(fileData []byte) JWTProfileTokenSource
func JWTProfileFromKeyAndUserID ¶
func JWTProfileFromKeyAndUserID(key []byte, keyID, userID string) JWTProfileTokenSource
func JWTProfileFromPath ¶
func JWTProfileFromPath(keyPath string) JWTProfileTokenSource
type OrgInterceptor ¶
type OrgInterceptor struct {
// contains filtered or unexported fields
}
func NewOrgInterceptor ¶
func NewOrgInterceptor(orgID string) *OrgInterceptor
NewOrgInterceptor statically set the organisation context for every call
If you need to switch between multiple organisations for different requests, use the SetOrgID function directly on your calls (see example/mgmt/mgmt.go)
func (*OrgInterceptor) Stream ¶
func (interceptor *OrgInterceptor) Stream() grpc.StreamClientInterceptor
func (*OrgInterceptor) Unary ¶
func (interceptor *OrgInterceptor) Unary() grpc.UnaryClientInterceptor