func Context() context.Context
func ContextForUser(user *apb.User) (context.Context, error)
create an outbound context for a given user. user must be valid and signed this is an expensive call this is not privileged (user must be signed)
func ContextForUserID(userid string) (context.Context, error)
create an outbound context for a given user by id (with current service token) this is an expensive call it is also privileged
func ContextForUserIDWithTimeout(userid string, to time.Duration) (context.Context, error)
func ContextForUserWithTimeout(user *apb.User, secs uint64) (context.Context, error)
func ContextWithTimeout(t time.Duration) context.Context
this context gives a context with a full userobject
todo so it _has_ to call external servers to get a signed userobject. if started_by_autodeployer will use getContext() else if environment variable with context, will use auth.Context() (with variable) else create context by asking auth service for a signed user object
func ContextWithTimeoutAndTags(t time.Duration, rt *ge.CTXRoutingTags) context.Context
create a new context with routing tags. This is an EXPERIMENTAL API and very likely to change in future
func DIS_ContextV2WithTimeoutAndTags(t time.Duration, rt *ge.CTXRoutingTags) context.Context
func DIS_ContextV2WithTimeoutAndTagsForUser(t time.Duration, reqid string, user *apb.SignedUser, rt *ge.CTXRoutingTags) (context.Context, context.CancelFunc)
creates a new context for a user, with a timeout and routing tags and a cancel function userid may be "" (empty).
func DIS_build_new_ctx_meta_struct(requestid string, user, sudo *apb.SignedUser) *ge.InContext
build the struct we need to add to the context. used to create new contexts (e.g. in h2gproxy or in command line clients) it will determine the service itself. user and sudo may be nil. this is intented to be used as outbound context to other services
func DIS_contextFromStruct(ctx context.Context, inctx *ge.InContext) context.Context
func DerivedContextWithRouting(cv context.Context, kv map[string]string, fallback bool) context.Context
derive a context with routing tags (routing criteria to route to specific instances of a service) if fallback is true, fallback to any service without tags if none is found (default was false)
func GetAuthClient() apb.AuthenticationServiceClient
func GetAuthManagerClient() apb.AuthManagerServiceClient
func GetAuthenticationService() apb.AuthenticationServiceClient
compat with 'create', synonym for GetAuthClient()
func GetAuthenticationServiceClient() apb.AuthenticationServiceClient
compat with 'create', synonym for GetAuthClient()
func GetByToken(ctx context.Context, token string) *apb.User
func GetLocalServiceAccount() *apb.SignedUser
the local service's useraccount (nil if on commandline or service without useraccount)
func GetLocalUsers() (*apb.SignedUser, *apb.SignedUser)
get the user and service we are running as. Do not cache this result! (on boot the result may change once auth comes available)
func GetSignedUserByID(ctx context.Context, userid string) (*apb.SignedUser, error)
func GetUserByEmail(ctx context.Context, email string) (*apb.User, error)
func GetUserByID(ctx context.Context, userid string) (*apb.User, error)
func NewContextWithRouting(kv map[string]string, fallback bool) context.Context
create a new context with routing tags (routing criteria to route to specific instances of a service) if fallback is true, fallback to any service without tags if none is found (default was false)
func NewContextWithRoutingTags(rt *ge.CTXRoutingTags) context.Context
get a context with routing tags, specified by proto
func PartitionID(ctx context.Context) (uint64, error)
returns the partitionid for the user in this context. a partition is either:
the information in the context determines which partition will be returned a context without user information will always use partition 0
Note: currently this is a bit of a stub. it only resolves the userid to a partition and does not consider the organisation PartitionIDs start from 100 upwards. this is meant to make it easier for tools to support custom partitions, such as "any user" or "no user" or so
func SignedGetByEmail(ctx context.Context, email string) *apb.SignedUser
func SignedGetByToken(ctx context.Context, token string) *apb.SignedUser
func WhoAmI() *apb.User
a local context value
type CallStateV2 struct {
// contains filtered or unexported fields
}