refactor(identity): rename the api-key directory config to provider - #135
Merged
Merged
Conversation
The backend selector read as `directory: { kind: http }`, but http and file
are kinds of provider, not kinds of directory, and `directory` with
`kind: file` reads against the filesystem sense. Rename the config key and the
`DirectoryConfig` enum to `provider`/`ProviderConfig`.
Config surface only: the `KeyDirectory` trait, `DirectoryError`, and the
`directory` module keep their names, so the record-directory concept stays.
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rename the api-key resolver's backend selector from
directory:toprovider:, and theDirectoryConfigenum toProviderConfig. Follow-up to #125, landed before the plugin has downstream adopters. Config surface only, no behavior change.Motivation
The selector reads as
directory: { kind: http }, buthttpandfileare kinds of provider, not kinds of directory, so the noun and itskind:disagree.directorywithkind: filealso reads against the filesystem sense, a directory that contains a file.provider: { kind: http | file }reads as plain English and matches how operators already talk about an identity provider. The shared claim-mapping module from #119 already refers to the per-resolver piece as "provider-specific."Example
Before:
After:
Only the outer key changes. The
kind: file | httpdiscriminator and every field under it are unchanged.The file backend uses the same key, pointing at a local records file of digests:
What changed
Renamed the
directoryfield toproviderand theDirectoryConfigenum toProviderConfig, and updated the cache-over-file validation message, thefactory.rsconfig example, the two backendKINDdoc lines, and the test config keys. TheKeyDirectorytrait,DirectoryError, and thedirectorymodule keep their names, so the record-directory concept and the internal plumbing are unchanged. The serdetag = "kind"and thekind: file | httpshape are unchanged, so only the outer key name moves.cargo build,cargo test(80 passing),cargo clippy, andcargo fmt --checkare green for the plugin.