Documentation ¶
Index ¶
- Constants
- func AuthorizedUserCtx(ctx context.Context) context.Context
- func BearerTokenCtx(ctx context.Context, token string) context.Context
- func ScopeProjectID(projectID string) string
- func ScopeZitadelAPI() string
- type Client
- func (c *Client) AdminService() admin.AdminServiceClient
- func (c *Client) AuthService() auth.AuthServiceClient
- func (c *Client) ManagementService() management.ManagementServiceClient
- func (c *Client) OIDCService() oidc_pb.OIDCServiceClient
- func (c *Client) OrganizationService() org.OrganizationServiceClient
- func (c *Client) SessionService() session.SessionServiceClient
- func (c *Client) SettingsService() settings.SettingsServiceClient
- func (c *Client) SystemService() system.SystemServiceClient
- func (c *Client) UserService() user.UserServiceClient
- type Option
- type TokenSourceInitializer
- func DefaultServiceUserAuthentication(path string, scopes ...string) TokenSourceInitializer
- func JWTAuthentication(file *client.KeyFile, scopes ...string) TokenSourceInitializer
- func PAT(pat string) TokenSourceInitializer
- func PasswordAuthentication(username, password string, scopes ...string) TokenSourceInitializer
Constants ¶
const (
//OrgHeader for setting the organisation context of client calls
OrgHeader = "x-zitadel-orgid"
)
Variables ¶
This section is empty.
Functions ¶
func AuthorizedUserCtx ¶
AuthorizedUserCtx will set the authorization token of the authorized context (user) to be used for a subsequent call. If there is no authorized context, the method will simply return the passed context back.
func BearerTokenCtx ¶
BearerTokenCtx will set the passed token to be used for a subsequent call.
func ScopeProjectID ¶
ScopeProjectID will add the requested projectID to the audience of the access and id token
func ScopeZitadelAPI ¶
func ScopeZitadelAPI() string
ScopeZitadelAPI adds the projectID of ZITADEL to the audience
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AdminService ¶
func (c *Client) AdminService() admin.AdminServiceClient
func (*Client) AuthService ¶
func (c *Client) AuthService() auth.AuthServiceClient
func (*Client) ManagementService ¶
func (c *Client) ManagementService() management.ManagementServiceClient
func (*Client) OIDCService ¶
func (c *Client) OIDCService() oidc_pb.OIDCServiceClient
func (*Client) OrganizationService ¶
func (c *Client) OrganizationService() org.OrganizationServiceClient
func (*Client) SessionService ¶
func (c *Client) SessionService() session.SessionServiceClient
func (*Client) SettingsService ¶
func (c *Client) SettingsService() settings.SettingsServiceClient
func (*Client) SystemService ¶
func (c *Client) SystemService() system.SystemServiceClient
func (*Client) UserService ¶
func (c *Client) UserService() user.UserServiceClient
type Option ¶
type Option func(*clientOptions)
func WithAuth ¶
func WithAuth(initTokenSource TokenSourceInitializer) Option
WithAuth allows to set a token source as authorization, e.g. PAT, resp. provide an authentication mechanism, such as JWT Profile (JWTAuthentication) or Password (PasswordAuthentication) for service users.
func WithGRPCDialOptions ¶
func WithGRPCDialOptions(opts ...grpc.DialOption) Option
WithGRPCDialOptions allows to use custom grpc dial options when establishing connection with Zitadel. Multiple calls to WithGRPCDialOptions is allowed, options will be appended.
type TokenSourceInitializer ¶
func DefaultServiceUserAuthentication ¶
func DefaultServiceUserAuthentication(path string, scopes ...string) TokenSourceInitializer
DefaultServiceUserAuthentication is a short version of JWTAuthentication with a key.json read from a provided path.
func JWTAuthentication ¶
func JWTAuthentication(file *client.KeyFile, scopes ...string) TokenSourceInitializer
JWTAuthentication allows using the OAuth2 JWT Profile Grant to get a token using a key.json of a service user provided by ZITADEL.
func PAT ¶
func PAT(pat string) TokenSourceInitializer
PAT allows setting a service user personal access token to be used for authorization.
func PasswordAuthentication ¶
func PasswordAuthentication(username, password string, scopes ...string) TokenSourceInitializer
PasswordAuthentication allows using the OAuth2 Client Credentials Grant to get a token using username and password of a service user provided by ZITADEL.