Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish and version dex's configuration format #968

Open
ericchiang opened this issue Jun 13, 2017 · 1 comment
Open

Publish and version dex's configuration format #968

ericchiang opened this issue Jun 13, 2017 · 1 comment

Comments

@ericchiang
Copy link
Contributor

ericchiang commented Jun 13, 2017

A very common task when using dex is dynamically re-configuring it. Users install dex with static users then migrate to other connectors like LDAP. Doing this manually is often error prone but automating this process is hard without lots of YAML-foo.

Dex should take inspiration from Kubernetes' component config concept and start treating its configuration as a API that higher level config management systems (like Kubernetes) will have to interact with. This means formalizing, publishing, and versioning dex's configuration format. Possibly as a package, possibly as a JSON schema.

Useful links:

kubernetes/kubernetes#12245

Potential issues:

  • Use of json.RawMessage is problematic since it's by definition unstructured. We might consider modifying our config format to take more explicit fields.
type Config struct {
    Connectors []Connector `json:"connectors"`
    // ...
}

type Connector struct {
    Name string `json:"name"`
    ID   string `json:"id"`

    // Enumerate connectors instead of using a RawMessage.
    LDAP *LDAPConnector `json:"ldap"`
    OIDC *OIDCConnector `json:"oidc"`
    SAML *SAMLConnector `json:"saml"`
}
  • Having certain fields be magically evaluated as ENV vars is somewhat inconsistent since this acts on the raw bytes instead of holding additional fields.

Like json.RawMessage we might consider more explicit fields where filling in a field from an alternative source would be useful:

type Client struct {
    ClientSecret         string `json:"clientSecret"`
    ClientSecretFromEnv  string `json:"clientSecretFromEnv"`
    ClientSecretFromFile string `json:"clientSecretFromFile"`
}

cc @rithujohn191 @squat

@srenatus
Copy link
Contributor

srenatus commented Nov 1, 2017

Heya -- Is there anything new to say about this? I'm just curious. Dynamic configuration of connectors would be sweet. 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants