Documentation
¶
Index ¶
Constants ¶
View Source
const ( Name = "authorize" CurrentClaims = "claims" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorize ¶
type Authorize interface {
Authorize(auth authenticate.Authenticate, scopes ...string) (*Claims, error)
}
type Claims ¶
type Claims struct {
ID string `json:"id,omitempty"`
Unit string `json:"unit,omitempty"`
Username string `json:"username,omitempty"`
Name string `json:"name,omitempty"`
Surname string `json:"surname,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
func Authorized ¶
func Authorized(ctx context.Context, token authenticate.Authenticate, scopes ...string) (*Claims, error)
func FromContext ¶
Click to show internal directories.
Click to hide internal directories.