mirror of https://github.com/dexidp/dex.git
7 changed files with 101 additions and 9 deletions
@ -0,0 +1,39 @@
|
||||
package main |
||||
|
||||
import ( |
||||
"testing" |
||||
|
||||
"github.com/coreos/poke/storage" |
||||
"github.com/kylelemons/godebug/pretty" |
||||
|
||||
yaml "gopkg.in/yaml.v2" |
||||
) |
||||
|
||||
func TestUnmarshalClients(t *testing.T) { |
||||
data := `staticClients: |
||||
- id: example-app |
||||
redirectURIs: |
||||
- 'http://127.0.0.1:5555/callback'
|
||||
name: 'Example App' |
||||
secret: ZXhhbXBsZS1hcHAtc2VjcmV0 |
||||
` |
||||
var c Config |
||||
if err := yaml.Unmarshal([]byte(data), &c); err != nil { |
||||
t.Fatal(err) |
||||
} |
||||
|
||||
wantClients := []storage.Client{ |
||||
{ |
||||
ID: "example-app", |
||||
Name: "Example App", |
||||
Secret: "ZXhhbXBsZS1hcHAtc2VjcmV0", |
||||
RedirectURIs: []string{ |
||||
"http://127.0.0.1:5555/callback", |
||||
}, |
||||
}, |
||||
} |
||||
|
||||
if diff := pretty.Compare(wantClients, c.StaticClients); diff != "" { |
||||
t.Errorf("did not get expected clients: %s", diff) |
||||
} |
||||
} |
||||
@ -0,0 +1,27 @@
|
||||
issuer: http://127.0.0.1:5556 |
||||
storage: |
||||
# NOTE(ericchiang): This will be replaced by sqlite3 in the future. |
||||
type: memory |
||||
|
||||
web: |
||||
http: 127.0.0.1:5556 |
||||
|
||||
connectors: |
||||
- type: mock |
||||
id: mock |
||||
name: Mock |
||||
- type: github |
||||
id: github |
||||
name: GitHub |
||||
config: |
||||
clientID: "$GITHUB_CLIENT_ID" |
||||
clientSecret: "$GITHUB_CLIENT_SECRET" |
||||
redirectURI: http://127.0.0.1:5556/callback/github |
||||
org: kubernetes |
||||
|
||||
staticClients: |
||||
- id: example-app |
||||
redirectURIs: |
||||
- 'http://127.0.0.1:5555/callback' |
||||
name: 'Example App' |
||||
secret: ZXhhbXBsZS1hcHAtc2VjcmV0 |
||||
Loading…
Reference in new issue