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

Add base64 encode / decode custom template functions #409

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

szh
Copy link
Contributor

@szh szh commented Dec 13, 2021

Desired Outcome

We would like to add support for two Golang template functions to allow users of Push to File custom templates to have the Secrets Provider perform base64 encoding and base64 decoding (respectively) on secrets retrieved from Conjur before rendering the secret values to a secret file.

Implemented Changes

Added support for b64enc and b64dec template functions.
Implemented using the standard Golang encoding/base64 package.

Connected Issue/Story

CyberArk internal issue link: ONYX-14094

Changelog

  • 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
  • A follow-up issue to update official docs has been filed here: insert issue ID
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@szh szh force-pushed the base64-template-funcs branch 2 times, most recently from 02cce94 to 90bbf1c Compare December 13, 2021 18:49
@szh szh requested a review from diverdane December 13, 2021 18:52
@szh szh self-assigned this Dec 13, 2021
@szh szh marked this pull request as ready for review December 13, 2021 19:16
@szh szh requested review from a team as code owners December 13, 2021 19:16
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.

That was quick! I like the separate file for custom template functions. LGTM!!!

@szh szh force-pushed the base64-template-funcs branch from 90bbf1c to e3333d8 Compare December 13, 2021 19:53
@codeclimate
Copy link

codeclimate bot commented Dec 13, 2021

Code Climate has analyzed commit e3333d8 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 91.2% (0.1% change).

View more on Code Climate.

@szh szh merged commit 43e0deb into main Dec 13, 2021
@szh szh deleted the base64-template-funcs branch December 13, 2021 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants