Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around SAMS primitive REST-based Accounts API. Most likely, you want to use the more service-to-service "Clients" API instead.
This API is needed when using SAMS to identify users, but not perform authorization checks. e.g. the caller will handle its own authorization checks based on the identity of the SAMS user. (The returned User.Sub, the SAMS account external ID.)
func NewClient ¶
func NewClient(samsHost string, tokenSource oauth2.TokenSource) *Client
NewClient constructs a new SAMS Accounts client, pointed to the supplied SAMS host. e.g. "https://accounts.sourcegraph.com".
Users should prefer to use the top-level 'sams.NewAccountsV1' constructor instead.
type MetadataSet ¶
type User ¶
type User struct { Sub string `json:"sub"` // OIDC-compliant field name, DO NOT change Name string `json:"name"` // OIDC-compliant field name, DO NOT change Email string `json:"email"` // OIDC-compliant field name, DO NOT change Picture string `json:"picture"` // OIDC-compliant field name, DO NOT change EmailVerified bool `json:"email_verified"` // OIDC-compliant field name, DO NOT change CreatedAt time.Time `json:"created_at"` // OIDC-compliant field name, DO NOT change // Metadata is a map of metadata scope to metadata JSON contents. Metadata MetadataSet `json:"metadata,omitempty"` }
Click to show internal directories.
Click to hide internal directories.