Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
376b1bcb
Commit
376b1bcb
authored
Dec 21, 2015
by
bobbyrullo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #209 from ericchiang/conn_docs
connector: document Connector and ConnectorConfig interfaces
parents
b40de37e
a5feafc8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
interface.go
connector/interface.go
+25
-1
No files found.
connector/interface.go
View file @
376b1bcb
...
@@ -14,8 +14,18 @@ import (
...
@@ -14,8 +14,18 @@ import (
var
ErrorNotFound
=
errors
.
New
(
"connector not found in repository"
)
var
ErrorNotFound
=
errors
.
New
(
"connector not found in repository"
)
type
Connector
interface
{
type
Connector
interface
{
// ID returns the ID of the ConnectorConfig used to create the Connector.
ID
()
string
ID
()
string
// LoginURL returns the backend's authorization URL for a sessionKey
// and OAuth2 prompt type.
LoginURL
(
sessionKey
,
prompt
string
)
(
string
,
error
)
LoginURL
(
sessionKey
,
prompt
string
)
(
string
,
error
)
// Register allows connectors to register a callback handler with the
// dex server.
//
// Connectors should register with a path that extends the namespace
// URL provided when the Connector is instantiated.
Register
(
mux
*
http
.
ServeMux
,
errorURL
url
.
URL
)
Register
(
mux
*
http
.
ServeMux
,
errorURL
url
.
URL
)
// Sync triggers any long-running tasks needed to maintain the
// Sync triggers any long-running tasks needed to maintain the
...
@@ -23,7 +33,8 @@ type Connector interface {
...
@@ -23,7 +33,8 @@ type Connector interface {
// repeatedly caching any remote resources for local use.
// repeatedly caching any remote resources for local use.
Sync
()
chan
struct
{}
Sync
()
chan
struct
{}
// TrustedEmailProvider indicates whether or not we can trust that email claims coming from this provider.
// TrustedEmailProvider indicates whether or not we can trust that email
// claims coming from this provider.
TrustedEmailProvider
()
bool
TrustedEmailProvider
()
bool
health
.
Checkable
health
.
Checkable
...
@@ -31,8 +42,21 @@ type Connector interface {
...
@@ -31,8 +42,21 @@ type Connector interface {
//go:generate genconfig -o config.go connector Connector
//go:generate genconfig -o config.go connector Connector
type
ConnectorConfig
interface
{
type
ConnectorConfig
interface
{
// ConnectorID returns a unique end user facing identifier. For example "google".
ConnectorID
()
string
ConnectorID
()
string
// ConnectorType returns an implementation specific identifier. For example "oidc".
ConnectorType
()
string
ConnectorType
()
string
// Connector is invoked by the dex server and returns a Connector configured
// to use the provided arguments. URL namespace is used to register callbacks.
// loginFunc is used to associate remote identies with dex session keys.
//
// The returned Connector must call loginFunc once upon successful
// identification of a user.
//
// Additional templates are passed for connectors that require rendering HTML
// pages, such as the "local" connector.
Connector
(
ns
url
.
URL
,
loginFunc
oidc
.
LoginFunc
,
tpls
*
template
.
Template
)
(
Connector
,
error
)
Connector
(
ns
url
.
URL
,
loginFunc
oidc
.
LoginFunc
,
tpls
*
template
.
Template
)
(
Connector
,
error
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment