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

feat(auth): add arbitrary list methods metadata field #1242

Merged
merged 2 commits into from
Dec 22, 2022

Conversation

GeorgeMac
Copy link
Contributor

@GeorgeMac GeorgeMac commented Dec 22, 2022

This adds a space for (relatively) arbitrary metadata for each authentication method.
Ultimately, this will support the UI is presenting appropriate login features.

e.g. Login with Google button.

There is a map[string]string metadata field on the auth method info message payload.
This can be configured by adding metadata in internal/config on the call to Info().

I have added an initial example where the OIDC method adds all of its providers authorize and callback URLs.
The UI will be able to use this information to correctly configured a login button based on what is actually configured in the backing Flipt instance.

For example:

{
  "methods": [
    {
      "method": "METHOD_TOKEN",
      "enabled": false,
      "sessionCompatible": false,
      "metadata": {}
    },
    {
      "method": "METHOD_OIDC",
      "enabled": false,
      "sessionCompatible": true,
      "metadata": {
        "provider.google.authorize_url": "/auth/v1/method/oidc/google/authorize",
        "provider.google.callback_url": "/auth/v1/method/oidc/google/callback"
      }
    }
  ]
}

@GeorgeMac GeorgeMac requested a review from a team as a code owner December 22, 2022 15:41
Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@markphelps markphelps enabled auto-merge (squash) December 22, 2022 16:13
@markphelps markphelps merged commit fd9b636 into main Dec 22, 2022
@markphelps markphelps deleted the gm/list-methods-metadata branch December 22, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants