Documentation ¶
Overview ¶
Package client implements the OAuth 2.0 Client functionality and provides http handlers, http clients and storage adapters.
Index ¶
- Constants
- type Client
- func (c *Client) GetGrantTypes() fosite.Arguments
- func (c *Client) GetHashedSecret() []byte
- func (c *Client) GetID() string
- func (c *Client) GetOwner() string
- func (c *Client) GetRedirectURIs() []string
- func (c *Client) GetResponseTypes() fosite.Arguments
- func (c *Client) GetScopes() fosite.Arguments
- func (c *Client) IsPublic() bool
- type HTTPManager
- func (m *HTTPManager) CreateClient(c *Client) error
- func (m *HTTPManager) DeleteClient(id string) error
- func (m *HTTPManager) GetClient(id string) (fosite.Client, error)
- func (m *HTTPManager) GetClients() (map[string]Client, error)
- func (m *HTTPManager) GetConcreteClient(id string) (*Client, error)
- func (m *HTTPManager) UpdateClient(c *Client) error
- type Handler
- func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h *Handler) SetRoutes(r *httprouter.Router)
- func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- type Manager
- type MemoryManager
- func (m *MemoryManager) Authenticate(id string, secret []byte) (*Client, error)
- func (m *MemoryManager) CreateClient(c *Client) error
- func (m *MemoryManager) DeleteClient(id string) error
- func (m *MemoryManager) GetClient(id string) (fosite.Client, error)
- func (m *MemoryManager) GetClients() (clients map[string]Client, err error)
- func (m *MemoryManager) GetConcreteClient(id string) (*Client, error)
- func (m *MemoryManager) UpdateClient(c *Client) error
- type RethinkManager
- func (m *RethinkManager) Authenticate(id string, secret []byte) (*Client, error)
- func (m *RethinkManager) ColdStart() error
- func (m *RethinkManager) CreateClient(c *Client) error
- func (m *RethinkManager) DeleteClient(id string) error
- func (m *RethinkManager) GetClient(id string) (fosite.Client, error)
- func (m *RethinkManager) GetClients() (clients map[string]Client, err error)
- func (m *RethinkManager) GetConcreteClient(id string) (*Client, error)
- func (m *RethinkManager) UpdateClient(c *Client) error
- func (m *RethinkManager) Watch(ctx context.Context)
- type SQLManager
- func (m *SQLManager) Authenticate(id string, secret []byte) (*Client, error)
- func (m *SQLManager) CreateClient(c *Client) error
- func (s *SQLManager) CreateSchemas() error
- func (m *SQLManager) DeleteClient(id string) error
- func (m *SQLManager) GetClient(id string) (fosite.Client, error)
- func (m *SQLManager) GetClients() (clients map[string]Client, err error)
- func (m *SQLManager) GetConcreteClient(id string) (*Client, error)
- func (m *SQLManager) UpdateClient(c *Client) error
- type Storage
Constants ¶
View Source
const ( ClientsResource = "rn:hydra:clients" ClientResource = "rn:hydra:clients:%s" Scope = "hydra.clients" )
View Source
const (
ClientsHandlerPath = "/clients"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string `json:"id" gorethink:"id"` Name string `json:"client_name" gorethink:"client_name"` Secret string `json:"client_secret,omitempty" gorethink:"client_secret"` RedirectURIs []string `json:"redirect_uris" gorethink:"redirect_uris"` GrantTypes []string `json:"grant_types" gorethink:"grant_types"` ResponseTypes []string `json:"response_types" gorethink:"response_types"` Scope string `json:"scope" gorethink:"scope"` Owner string `json:"owner" gorethink:"owner"` PolicyURI string `json:"policy_uri" gorethink:"policy_uri"` TermsOfServiceURI string `json:"tos_uri" gorethink:"tos_uri"` ClientURI string `json:"client_uri" gorethink:"client_uri"` LogoURI string `json:"logo_uri" gorethink:"logo_uri"` Contacts []string `json:"contacts" gorethink:"contacts"` Public bool `json:"public" gorethink:"public"` }
func (*Client) GetGrantTypes ¶
func (*Client) GetHashedSecret ¶
func (*Client) GetRedirectURIs ¶
func (*Client) GetResponseTypes ¶
type HTTPManager ¶ added in v0.2.0
func (*HTTPManager) CreateClient ¶ added in v0.2.0
func (m *HTTPManager) CreateClient(c *Client) error
func (*HTTPManager) DeleteClient ¶ added in v0.2.0
func (m *HTTPManager) DeleteClient(id string) error
func (*HTTPManager) GetClient ¶ added in v0.2.0
func (m *HTTPManager) GetClient(id string) (fosite.Client, error)
func (*HTTPManager) GetClients ¶ added in v0.2.0
func (m *HTTPManager) GetClients() (map[string]Client, error)
func (*HTTPManager) GetConcreteClient ¶ added in v0.2.0
func (m *HTTPManager) GetConcreteClient(id string) (*Client, error)
func (*HTTPManager) UpdateClient ¶ added in v0.5.0
func (m *HTTPManager) UpdateClient(c *Client) error
type Handler ¶
func (*Handler) Create ¶
func (h *Handler) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*Handler) Delete ¶
func (h *Handler) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Handler) Get ¶
func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Handler) GetAll ¶ added in v0.2.0
func (h *Handler) GetAll(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Handler) SetRoutes ¶
func (h *Handler) SetRoutes(r *httprouter.Router)
func (*Handler) Update ¶
func (h *Handler) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
type MemoryManager ¶
func (*MemoryManager) Authenticate ¶
func (m *MemoryManager) Authenticate(id string, secret []byte) (*Client, error)
func (*MemoryManager) CreateClient ¶
func (m *MemoryManager) CreateClient(c *Client) error
func (*MemoryManager) DeleteClient ¶
func (m *MemoryManager) DeleteClient(id string) error
func (*MemoryManager) GetClient ¶
func (m *MemoryManager) GetClient(id string) (fosite.Client, error)
func (*MemoryManager) GetClients ¶
func (m *MemoryManager) GetClients() (clients map[string]Client, err error)
func (*MemoryManager) GetConcreteClient ¶
func (m *MemoryManager) GetConcreteClient(id string) (*Client, error)
func (*MemoryManager) UpdateClient ¶
func (m *MemoryManager) UpdateClient(c *Client) error
type RethinkManager ¶ added in v0.2.0
type RethinkManager struct { Session *r.Session Table r.Term sync.RWMutex Clients map[string]Client Hasher fosite.Hasher }
func (*RethinkManager) Authenticate ¶ added in v0.2.0
func (m *RethinkManager) Authenticate(id string, secret []byte) (*Client, error)
func (*RethinkManager) ColdStart ¶ added in v0.2.0
func (m *RethinkManager) ColdStart() error
func (*RethinkManager) CreateClient ¶ added in v0.2.0
func (m *RethinkManager) CreateClient(c *Client) error
func (*RethinkManager) DeleteClient ¶ added in v0.2.0
func (m *RethinkManager) DeleteClient(id string) error
func (*RethinkManager) GetClient ¶ added in v0.2.0
func (m *RethinkManager) GetClient(id string) (fosite.Client, error)
func (*RethinkManager) GetClients ¶ added in v0.2.0
func (m *RethinkManager) GetClients() (clients map[string]Client, err error)
func (*RethinkManager) GetConcreteClient ¶ added in v0.2.0
func (m *RethinkManager) GetConcreteClient(id string) (*Client, error)
func (*RethinkManager) UpdateClient ¶ added in v0.5.0
func (m *RethinkManager) UpdateClient(c *Client) error
func (*RethinkManager) Watch ¶ added in v0.2.0
func (m *RethinkManager) Watch(ctx context.Context)
type SQLManager ¶
func (*SQLManager) Authenticate ¶
func (m *SQLManager) Authenticate(id string, secret []byte) (*Client, error)
func (*SQLManager) CreateClient ¶
func (m *SQLManager) CreateClient(c *Client) error
func (*SQLManager) CreateSchemas ¶
func (s *SQLManager) CreateSchemas() error
func (*SQLManager) DeleteClient ¶
func (m *SQLManager) DeleteClient(id string) error
func (*SQLManager) GetClients ¶
func (m *SQLManager) GetClients() (clients map[string]Client, err error)
func (*SQLManager) GetConcreteClient ¶
func (m *SQLManager) GetConcreteClient(id string) (*Client, error)
func (*SQLManager) UpdateClient ¶
func (m *SQLManager) UpdateClient(c *Client) error
Click to show internal directories.
Click to hide internal directories.