a418e1c4e7
adds a client manager to handle business logic, leaving the repo for basic crud operations. Also adds client to the test script
45 lines
853 B
Go
45 lines
853 B
Go
package repo
|
|
|
|
import (
|
|
"encoding/base64"
|
|
"net/url"
|
|
|
|
"github.com/coreos/go-oidc/oidc"
|
|
|
|
"github.com/coreos/dex/client"
|
|
)
|
|
|
|
var (
|
|
testClients = []client.Client{
|
|
client.Client{
|
|
Credentials: oidc.ClientCredentials{
|
|
ID: "client1",
|
|
Secret: base64.URLEncoding.EncodeToString([]byte("secret-1")),
|
|
},
|
|
Metadata: oidc.ClientMetadata{
|
|
RedirectURIs: []url.URL{
|
|
url.URL{
|
|
Scheme: "https",
|
|
Host: "client1.example.com",
|
|
Path: "/callback",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
client.Client{
|
|
Credentials: oidc.ClientCredentials{
|
|
ID: "client2",
|
|
Secret: base64.URLEncoding.EncodeToString([]byte("secret-2")),
|
|
},
|
|
Metadata: oidc.ClientMetadata{
|
|
RedirectURIs: []url.URL{
|
|
url.URL{
|
|
Scheme: "https",
|
|
Host: "client2.example.com",
|
|
Path: "/callback",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
)
|