Documentation
¶
Index ¶
- Variables
- func StringFromMeta(kv any, key string) string
- type 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 OSINStore
- type Scope
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidJSON = errors.New("Invalid JSON")
)
vars
Functions ¶
func StringFromMeta ¶ added in v0.12.0
StringFromMeta ...
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) GetGrantTypes ¶ added in v0.12.0
GetGrantTypes ...
func (*Client) GetRedirectUri ¶
GetRedirectUri oauth.Client
func (*Client) GetResponseTypes ¶ added in v0.12.0
GetResponseTypes ...
type ClientMeta ¶ added in v0.12.0
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 ¶ added in v0.12.0
func (m *ClientMeta) Scan(value interface{}) (err error)
Scan implements the sql.Scanner interface.
type ClientSpec ¶ added in v0.9.0
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 ¶ added in v0.12.0
JSONKV ...
type OSINStore ¶ added in v0.9.0
type OSINStore 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
}
OSINStore ...
Click to show internal directories.
Click to hide internal directories.