Documentation ¶
Overview ¶
based on egret/auth/client.go
Index ¶
- func APIOwnerFromContext(ctx context.Context) *ent.Owner
- func AddAPIClientToContext(ctx context.Context, client APIClient) context.Context
- func ClientIDHeaderAuthFunc(defaultClientID string, ownerClient internal.OwnerClient) grpc_auth.AuthFunc
- func NewBackgroundContextWithAPIClient(inCtx context.Context) (context.Context, context.CancelFunc, error)
- type APIClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIOwnerFromContext ¶
APIOwnerFromContext returns the api owner on context or panics if the client is missing
func AddAPIClientToContext ¶
AddAPIClientToContext returns a context with the client attached
func ClientIDHeaderAuthFunc ¶
func ClientIDHeaderAuthFunc(defaultClientID string, ownerClient internal.OwnerClient) grpc_auth.AuthFunc
ClientIDHeaderAuthFunc returns the authorization function that reads the client id from the metadata. Authorized Flow (Overrides) 1. Default Client ID provided at Server runtime 2. Client provides Client-ID
func NewBackgroundContextWithAPIClient ¶
func NewBackgroundContextWithAPIClient(inCtx context.Context) (context.Context, context.CancelFunc, error)
Returns a new background context with the api client set from the passed context. The returned context won't end when the passed context ends.
Types ¶
type APIClient ¶
APIClient provides access to info about the client
func APIClientFromContext ¶
APIClientFromContext returns the api client on context or an error if the client is missing
func NewAPIClient ¶
NewAPIClient constructs a API Client