Documentation ¶
Index ¶
- Constants
- Variables
- func Authorize(w http.ResponseWriter, r *http.Request, realm string, ...) tlv.Values
- func BasicAuth(username, password string) string
- func Error401(w http.ResponseWriter, realm string)
- func Error401f(w http.ResponseWriter, realm, error, desc string, a ...interface{})
- func ParseBasicAuth(authorization string) (username, password string, ok bool)
- func VerifyClientCredentials(id, secret string, clientIDSecret []byte) bool
- func VerifyToken(token []byte, pub ed25519.PublicKey) bool
- type Asset
- type Client
- type ClientStore
- func (store *ClientStore) Asset(name string) ([]*Asset, error)
- func (store *ClientStore) Client(id string) ([]*Client, error)
- func (store *ClientStore) Clients() ([]*Client, error)
- func (store *ClientStore) Close() error
- func (store *ClientStore) NewAsset(name string, data []byte) (*Asset, error)
- func (store *ClientStore) NewClient(tenant string, name string, clientIDSecret []byte) (*Client, error)
- func (store *ClientStore) NewTenant(name string) (*Tenant, error)
- func (store *ClientStore) Tenant(id string) ([]*Tenant, error)
- func (store *ClientStore) TenantByName(name string) ([]*Tenant, error)
- func (store *ClientStore) Tenants() ([]*Tenant, error)
- type ID
- type OAuth2Client
- type Tenant
- type TenantID
- type TokenResponse
Constants ¶
View Source
const ( TOKEN_VALUES tlv.Type = iota TOKEN_SIGNATURE T_TENANT_ID T_CLIENT_ID T_NOT_BEFORE T_NOT_AFTER T_SCOPE )
View Source
const ( KEY_CLIENT_ID_SECRET = "client-id-secret" KEY_TOKEN_SIGNATURE_KEY = "token-signature-key" )
View Source
const (
ASSET_AUTH_PUBKEY = "auth-pubkey"
)
View Source
const (
SCOPE_ADMIN tlv.Type = iota
)
Variables ¶
View Source
var ( TokenSymtab = tlv.Symtab{ TOKEN_VALUES: tlv.Symbol{ Name: "values", Child: tlv.Symtab{ T_TENANT_ID: tlv.Symbol{ Name: "tenant_id", }, T_CLIENT_ID: tlv.Symbol{ Name: "client_id", }, T_NOT_BEFORE: tlv.Symbol{ Name: "not_before", }, T_NOT_AFTER: tlv.Symbol{ Name: "not_after", }, T_SCOPE: tlv.Symbol{ Name: "scope", Child: tlv.Symtab{ SCOPE_ADMIN: tlv.Symbol{ Name: "admin", }, }, }, }, }, TOKEN_SIGNATURE: tlv.Symbol{ Name: "signature", }, } )
Functions ¶
func Error401 ¶
func Error401(w http.ResponseWriter, realm string)
func Error401f ¶
func Error401f(w http.ResponseWriter, realm, error, desc string, a ...interface{})
func ParseBasicAuth ¶
func VerifyClientCredentials ¶
Types ¶
type Asset ¶
func UnmarshalAsset ¶
type ClientStore ¶
type ClientStore struct {
// contains filtered or unexported fields
}
func NewClientStore ¶
func NewClientStore() (*ClientStore, error)
func (*ClientStore) Clients ¶
func (store *ClientStore) Clients() ([]*Client, error)
func (*ClientStore) Close ¶
func (store *ClientStore) Close() error
func (*ClientStore) NewAsset ¶
func (store *ClientStore) NewAsset(name string, data []byte) (*Asset, error)
func (*ClientStore) TenantByName ¶
func (store *ClientStore) TenantByName(name string) ([]*Tenant, error)
func (*ClientStore) Tenants ¶
func (store *ClientStore) Tenants() ([]*Tenant, error)
type OAuth2Client ¶
type OAuth2Client struct { TokenEndpoint string // contains filtered or unexported fields }
func NewOAuth2Client ¶
func NewOAuth2Client(id, secret, token string) *OAuth2Client
func (*OAuth2Client) GetToken ¶
func (client *OAuth2Client) GetToken() (*TokenResponse, error)
type Tenant ¶
func UnmarshalTenant ¶
Click to show internal directories.
Click to hide internal directories.