Documentation
¶
Index ¶
- Constants
- func GetOIDCClaims(claims map[string]interface{}) *session.OIDCClaim
- func New(signer signing.Signer, verifier signing.Verifier) *signingService
- type Auth
- type AuthParser
- type Authorization
- type Data
- type GSIConfig
- type Grant
- type IdTokenExchanger
- type MIPConfig
- type Organization
- type Payload
- type Profile
- type SignInResponse
- type TokenBuilder
- type UserProfile
Constants ¶
View Source
const ( AUTH_GSI Auth = "gsi" AuthParserGoogle AuthParser = "gsi" )
Variables ¶
This section is empty.
Functions ¶
func GetOIDCClaims ¶
Types ¶
type AuthParser ¶
type AuthParser string
type Authorization ¶
type Grant ¶
type Grant struct {
// DO NOT USE THIS AS BACK-END VALIDATION!!!!!!!!!!!!!!!!!!!!!!!!!!!
UserId string `json:"user_id,omitempty"`
// DO NOT USE THIS AS BACK-END VALIDATION!!!!!!!!!!!!!!!!!!!!!!!!!!!
GroupId string `json:"group_id,omitempty"`
// DO NOT USE THIS AS BACK-END VALIDATION!!!!!!!!!!!!!!!!!!!!!!!!!!!
Name string `json:"name,omitempty"`
// DO NOT USE THIS AS BACK-END VALIDATION!!!!!!!!!!!!!!!!!!!!!!!!!!!
UiAndApiPermission map[string]bool `` /* 127-byte string literal not displayed */
}
DO NOT USE THIS AS BACK-END VALIDATION!!!!!!!!!!!!!!!!!!!!!!!!!!!
type IdTokenExchanger ¶
type IdTokenExchanger struct {
// contains filtered or unexported fields
}
func NewIdTokenExchanger ¶
func NewIdTokenExchanger( verifierName string, verifier signing.VerifierOf[*idtoken.Payload], signer signing.Signer, ) *IdTokenExchanger
func (*IdTokenExchanger) ExchangeToken ¶
func (g *IdTokenExchanger) ExchangeToken( tokenBuilder TokenBuilder, ) httprouter.Handle
Convenient handler for exchanging token
func (*IdTokenExchanger) WithAuthorization ¶
func (g *IdTokenExchanger) WithAuthorization(handler httprouter.Handle) httprouter.Handle
WithAuthorization is for more generic authorization
type Organization ¶
type Payload ¶
type Payload struct {
Email string `json:"email"` // email (as ID, possible improvements)
Profile UserProfile `json:"profile"`
GSI GSIConfig `json:"gsi"`
MIP MIPConfig `json:"mip"`
DefaultHomepage string `json:"default_homepage"`
Authorization map[string]Authorization `json:"authorization"` // organization/tenant id as key
}
type SignInResponse ¶
type SignInResponse struct {
// Profile from OIDC provider
LoginProfile *Profile `json:"login_profile,omitempty"`
Locale []string `json:"locale,omitempty"`
IDToken *string `json:"id_token,omitempty"`
// Collection of grants NOT signed, for debugging.
// DO NOT USE THIS FOR BACK END VALIDATION!!!
Grants map[string]*session.Grant `json:"grants"`
Expiry string `json:"expiry,omitempty"`
Data any `json:"data,omitempty"`
}
type TokenBuilder ¶
type UserProfile ¶
type UserProfile struct {
ID string `json:"id"`
ImageURL string `json:"image_url"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Role string `json:"role"`
Description string `json:"description"`
Avatar1x1URL string `json:"avatar_1x1_url"`
Background3x1URL string `json:"background_3x1_url"`
CreatedAt string `json:"created_at"`
}
Click to show internal directories.
Click to hide internal directories.