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

Configure Authn client with annotations #366

Merged
merged 4 commits into from
Oct 18, 2021
Merged

Configure Authn client with annotations #366

merged 4 commits into from
Oct 18, 2021

Conversation

john-odonnell
Copy link
Contributor

@john-odonnell john-odonnell commented Sep 30, 2021

What does this PR do?

TODO
This PR updates the Authenticator client dependency from v0.19.1 to a recent unreleased commit, cyberark/conjur-authn-k8s-client@5ca2371, in order to use unreleased functionality. Eventually, go.mod and go.sum should point to the next authn client release to include these changes.

Configures the K8s authenticator with annotations using new functions implemented in cyberark/conjur-authn-k8s-client#407.

  • Gather authenticator settings from a custom env of and annotations, envvars and defaults
  • Confirm settings will create a valid authenticator configuration
  • Create a new authn-k8s config from the gathered and validated settings

What ticket does this PR close?

ONYX-11828
Resolves #340

Checklists

Change log

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR, and/or there is a follow-on issue to update docs, or
  • This PR does not require updating any documentation

@john-odonnell john-odonnell force-pushed the ONYX-11828 branch 5 times, most recently from dc38906 to 93fb297 Compare October 13, 2021 16:53
@john-odonnell john-odonnell force-pushed the ONYX-11828 branch 6 times, most recently from 124bc7b to aae0ead Compare October 14, 2021 17:26
@codeclimate
Copy link

codeclimate bot commented Oct 14, 2021

Code Climate has analyzed commit aae0ead and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 92.6% (0.0% change).

View more on Code Climate.

@john-odonnell john-odonnell changed the title WIP - Configure authenticator with annotations Configure Authn client with annotations Oct 14, 2021
@john-odonnell john-odonnell marked this pull request as ready for review October 14, 2021 17:37
@john-odonnell john-odonnell requested review from a team as code owners October 14, 2021 17:37
Copy link
Contributor

@diverdane diverdane left a comment

Choose a reason for hiding this comment

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

LGTM!!!

@@ -24,3 +24,5 @@ const CSPFK009I string = "CSPFK009I DAP/Conjur Secrets updated in Kubernetes suc
const CSPFK010I string = "CSPFK010I Updating Kubernetes Secrets: %d retries out of %d"
const CSPFK011I string = "CSPFK011I Annotation '%s' valid, but not recognized"
const CSPFK012I string = "CSPFK012I Secrets Provider setting '%s' set by both environment variable '%s' and annotation '%s'"
const CSPFK013I string = "CSPFK013I Gathering settings for Authenticator client configuration..."
const CSPFK014I string = "CSPFK014I Authenticator setting %s provided by %s"
Copy link
Contributor

Choose a reason for hiding this comment

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

NICE! This will be very helpful knowing the source of config.

log.Info(messages.CSPFK014I, key, "environment")
}

return os.Getenv(key)
Copy link
Contributor

Choose a reason for hiding this comment

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

This reminds me... At some point, we'll want to add UT for this main.go, and we'll probably want to use dependency injection for the os functions so we can test with a mock os.

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.

Client Configurations via annotations M1
2 participants