Documentation ¶
Index ¶
- Constants
- func Account(ctx context.Context) *model.Account
- func Get(ctx context.Context) *scs.SessionManager
- func NewCrossAuthHeader(accid, uid uint64) string
- func ParseCrossAuthHeader(val string) (accid, uid uint64)
- func Token(ctx context.Context) string
- func User(ctx context.Context) *model.User
- func UserAccount(ctx context.Context) (u *model.User, a *model.Account)
- func WithAnonymousUserAccount(ctx context.Context) context.Context
- func WithSession(ctx context.Context, manager *scs.SessionManager) context.Context
- func WithToken(ctx context.Context, token string) context.Context
- func WithUserAccount(ctx context.Context, userObj *model.User, accountObj *model.Account) context.Context
- func WithUserAccountDevelop(ctx context.Context) context.Context
Constants ¶
View Source
const ( PermAuthCross = `auth.cross` AnonymousDefaultRole = `anonymous` )
Permission auth specific constants
View Source
const CrossAuthHeader = "auth.cross.account"
CrossAuthHeader value as AccountID[:UserID]
Variables ¶
This section is empty.
Functions ¶
func NewCrossAuthHeader ¶
NewCrossAuthHeader from Account & User ID
func ParseCrossAuthHeader ¶
ParseCrossAuthHeader from value
func UserAccount ¶
UserAccount returns user + account models
func WithAnonymousUserAccount ¶
WithAnonymousUserAccount puts to context user and account with anonym permissions
func WithSession ¶
WithSession context wrapper
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.