Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) CopyFrom(other storage.Client)
- func (c *Client) GetGrantTypes() []string
- func (c *Client) GetId() string
- func (c *Client) GetName() string
- func (c *Client) GetRedirectUri() string
- func (c *Client) GetResponseTypes() []string
- func (c *Client) GetScopes() []string
- func (c *Client) GetSecret() string
- func (c *Client) GetUserData() interface{}
- func (c *Client) String() string
- type ClientMeta
- type ClientSpec
- type JSONKV
- type Scope
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidJSON = errors.New("Invalid JSON")
)
vars
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string `json:"id" db:"id" ` // pk Secret string `json:"secret" db:"secret"` RedirectURI string `json:"redirectURI" db:"redirect_uri" ` Meta ClientMeta `json:"meta,omitempty" db:"meta" ` // jsonb CreatedAt time.Time `json:"created,omitempty" db:"created" ` // time.Now() }
Client of oauth2
func (*Client) GetRedirectUri ¶
GetRedirectUri oauth.Client
type ClientMeta ¶
type ClientMeta struct { Name string `json:"name,omitempty"` GrantTypes []string `json:"grant_types,omitempty"` // AllowedGrantTypes ResponseTypes []string `json:"response_types,omitempty"` // AllowedResponseTypes Scopes []string `json:"scopes,omitempty"` // AllowedScopes }
ClientMeta ...
func (*ClientMeta) Scan ¶
func (m *ClientMeta) Scan(value interface{}) (err error)
Scan implements the sql.Scanner interface.
type ClientSpec ¶
type ClientSpec struct { Page int `json:"page,omitempty" form:"page"` Limit int `json:"limit,omitempty" form:"limit"` Orders []string `json:"order,omitempty" form:"order"` Total int `json:"total,omitempty"` // for set value CountOnly bool `json:"count,omitempty" form:"count"` }
ClientSpec 查询参数
type JSONKV ¶
type JSONKV map[string]interface{}
JSONKV ...
type Scope ¶
type Scope struct { Name string `json:"name"` Label string `json:"label"` Description string `json:"description,omitempty"` IsDefault bool `json:"is_default,omitempty" db:"is_default"` }
Scope ...
type Store ¶
type Store interface { osin.Storage LoadClient(id string) (*Client, error) LoadClients(spec *ClientSpec) ([]Client, error) CountClients() uint SaveClient(client *Client) error RemoveClient(id string) error LoadScopes() (scopes []Scope, err error) IsAuthorized(clientID, username string) bool SaveAuthorized(clientID, username string) error }
Store ...
Click to show internal directories.
Click to hide internal directories.