plugin

package
v0.0.0-...-014c3c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthCtxKey key = "auth-ctx-key"
)

Variables

This section is empty.

Functions

func AdminAuthLogic

func AdminAuthLogic(adminEmail map[string]struct{}, expiryMinutes int) *adminAuth

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 MyContentWithAuth[T mycontent.Data](base mycontent.Usecase[T]) *mcAuth[T]

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

func ParseToken(ctx context.Context, payload []byte) (any, *types.CommonError)

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"`
}

type Profile

type Profile struct {
	URL              string `json:"url"`
	DisplayName      string `json:"display_name"`
	ImageDataURL     string `json:"image_data_url"`
	ImageURL         string `json:"image_url"`
	Avatar1x1URL     string `json:"avatar_1x1_url"`
	Background3x1URL string `json:"background_3x1_url"`
	Email            string `json:"email"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL