Documentation
¶
Index ¶
- Constants
- func AdminAuthLogic(adminEmail map[string]struct{}, expiryMinutes int) *adminAuth
- func AdminOnly(handler httprouter.Handle) httprouter.Handle
- func MyContentAttachmentWithAuth(base *mycontent_base.HandlerWithAttachment) *mcAttachAuth
- func MyContentWithAuth[T mycontent.Data](base mycontent.Usecase[T]) *mcAuth[T]
- func NewUserAuthLogic(authUser mycontent.Usecase[*entity.UserAuthorization], expiryMinutes int) *userAuth
- func ParseToken(ctx context.Context, payload []byte) (any, *types.CommonError)
- type AuthData
- type Profile
Constants ¶
View Source
const (
AuthCtxKey key = "auth-ctx-key"
)
Variables ¶
This section is empty.
Functions ¶
func AdminAuthLogic ¶
AdminAuthLogic from id token (google, microsoft, etc.) in to our own self signed token
func AdminOnly ¶
func AdminOnly(handler httprouter.Handle) httprouter.Handle
func MyContentAttachmentWithAuth ¶
func MyContentAttachmentWithAuth(base *mycontent_base.HandlerWithAttachment) *mcAttachAuth
func MyContentWithAuth ¶
func NewUserAuthLogic ¶
func NewUserAuthLogic(authUser mycontent.Usecase[*entity.UserAuthorization], expiryMinutes int) *userAuth
AdminAuthLogic from id token (google, microsoft, etc.) in to our own self signed token
func ParseToken ¶
Types ¶
type AuthData ¶
type AuthData 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"`
}
Click to show internal directories.
Click to hide internal directories.