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

SnowflakeDB - Add username customization #7

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

MilenaHC
Copy link
Contributor

@MilenaHC MilenaHC commented Jul 1, 2021

Overview

Adds the ability to customize username generation for dynamic users in SnowflakeDB.

Uses the new field username_template with the go template language.

@MilenaHC
Copy link
Contributor Author

MilenaHC commented Jul 1, 2021

Test

Ran existing acceptance tests and manually tested that username customization works as expected

=== RUN   TestSnowflakeSQL_Initialize
--- PASS: TestSnowflakeSQL_Initialize (1.46s)
=== RUN   TestSnowflake_NewUser
=== RUN   TestSnowflake_NewUser/name_creation
=== RUN   TestSnowflake_NewUser/username_creation
=== RUN   TestSnowflake_NewUser/empty_creation
2021/07/01 15:13:24 query issue: 001003 (42000): SQL compilation error:
syntax error line 1 at position 10 unexpected '<EOF>'.
--- PASS: TestSnowflake_NewUser (7.44s)
    --- PASS: TestSnowflake_NewUser/name_creation (3.45s)
    --- PASS: TestSnowflake_NewUser/username_creation (3.05s)
    --- PASS: TestSnowflake_NewUser/empty_creation (0.94s)
=== RUN   TestSnowflake_RenewUser
--- PASS: TestSnowflake_RenewUser (6.23s)
=== RUN   TestSnowflake_RevokeUser
=== RUN   TestSnowflake_RevokeUser/default_revoke
=== RUN   TestSnowflake_RevokeUser/name_revoke
=== RUN   TestSnowflake_RevokeUser/username_revoke
--- PASS: TestSnowflake_RevokeUser (9.97s)
    --- PASS: TestSnowflake_RevokeUser/default_revoke (3.50s)
    --- PASS: TestSnowflake_RevokeUser/name_revoke (2.90s)
    --- PASS: TestSnowflake_RevokeUser/username_revoke (3.57s)
=== RUN   TestSnowflakeSQL_DefaultUsernameTemplate
--- PASS: TestSnowflakeSQL_DefaultUsernameTemplate (2.63s)
=== RUN   TestSnowflakeSQL_CustomUsernameTemplate
--- PASS: TestSnowflakeSQL_CustomUsernameTemplate (2.52s)
PASS
ok      github.com/hashicorp/vault-plugin-database-snowflake    30.416s

snowflake_test.go Outdated Show resolved Hide resolved
Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
@MilenaHC MilenaHC merged commit 2ccf274 into main Jul 6, 2021
@MilenaHC MilenaHC deleted the snowflake-username-customization branch July 6, 2021 14:11
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.

3 participants