Documentation ¶
Index ¶
- Variables
- func GetMergeParamsFromGrpcContext(ctx context.Context) (map[string]string, error)
- func GetNextPageToken(response *http.Response) (string, error)
- func KratosAdminCli() *ory.APIClient
- func KratosPublicCli() *ory.APIClient
- func SessionFromToken(token string, tk TokenKind) (*ory.Session, error)
- type Identity
- type IdentityTraits
- type TokenKind
Constants ¶
This section is empty.
Variables ¶
var ( // Well known locations of kratos services within this namespace. KratosPubURL string = "http://kratos-public" KratosAdminURL string = "http://kratos-admin" )
var ( // The sole user that is always in charge of identity and is an admin. // The bootstrap portal identity. Admin string = "ops" )
Functions ¶
func GetMergeParamsFromGrpcContext ¶ added in v1.3.10
func GetNextPageToken ¶ added in v1.2.8
GetNextPageToken parses the link header in the response to get the next page of the API See: https://www.ory.sh/docs/ecosystem/api-design#pagination Stolen from Ory Slack
func KratosAdminCli ¶ added in v1.1.22
func KratosPublicCli ¶ added in v1.1.22
Types ¶
type Identity ¶
type Identity struct { Id string `json:"id"` Traits IdentityTraits `json:"traits"` }
func GetIdForUser ¶ added in v1.1.22
type IdentityTraits ¶
type IdentityTraits struct { Email string `json:"email"` Username string `json:"username"` Admin bool `json:"admin"` Traits map[string]string `json:"traits"` }
These stucts must match the identity schemas given to kratos.
Here is Kratos internally generating this data and passing it around. API yaml Identity Traits: https://github.com/ory/kratos-client-go/blob/master/api/openapi.yaml && https://github.com/ory/kratos-client-go/blob/master/api/openapi.yaml#L2815. This generates: https://github.com/ory/kratos-client-go/blob/master/model_admin_create_identity_body.go#L31 The type of these Traits are `map[string]interface{}`. This type is set by the Open API generator.
The values that Merge Portal uses are here: https://gitlab.com/mergetb/portal/helm/-/blob/main/auth/values.yaml#L152
func GRPCCaller ¶ added in v1.1.22
func GRPCCaller(ctx context.Context, allow_inactive bool) (*IdentityTraits, error)
func GetUserAndTraits ¶ added in v1.1.48
func (*IdentityTraits) Read ¶ added in v1.1.22
func (i *IdentityTraits) Read(oryTraits map[string]interface{}) error
type TokenKind ¶ added in v1.1.22
type TokenKind int