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

Migrate to Database v5 interface #41

Merged
merged 7 commits into from
Oct 27, 2020
Merged

Migrate to Database v5 interface #41

merged 7 commits into from
Oct 27, 2020

Conversation

pcman312
Copy link
Contributor

@pcman312 pcman312 commented Sep 23, 2020

Overview

Converts plugin to use the Database v5 interface introduced in hashicorp/vault#9641

Design of Change

Converted each of the functions over to their equivalent in the new interface.
Init -> Initialize
CreateUser -> NewUser
RenewUser, SetCredentials, & RotateRootCredentials -> UpdateUser
RevokeUser -> DeleteUser

Test Output

Test Output
$ richgo test -v
START| Oracle_Initialize
PASS | Oracle_Initialize (12.41s)
START| Oracle_NewUser
START|   Oracle_NewUser/name_creation
START|   Oracle_NewUser/username_creation
START|   Oracle_NewUser/empty_creation
PASS | Oracle_NewUser (33.25s)
PASS |   Oracle_NewUser/name_creation (11.41s)
PASS |   Oracle_NewUser/username_creation (9.61s)
PASS |   Oracle_NewUser/empty_creation (12.23s)
START| Oracle_RenewUser
PASS | Oracle_RenewUser (14.73s)
START| Oracle_RevokeUser
START|   Oracle_RevokeUser/default_revoke
START|   Oracle_RevokeUser/name_revoke
START|   Oracle_RevokeUser/username_revoke
PASS | Oracle_RevokeUser (15.68s)
PASS |   Oracle_RevokeUser/default_revoke (1.25s)
PASS |   Oracle_RevokeUser/name_revoke (0.42s)
PASS |   Oracle_RevokeUser/username_revoke (0.38s)
START| SplitQueries
START|   SplitQueries/empty_input
START|   SplitQueries/only_semicolons
START|   SplitQueries/single_input
START|   SplitQueries/single_input_with_leading_semicolon
START|   SplitQueries/nil_input
START|   SplitQueries/string_with_only_semicolon
START|   SplitQueries/single_input_with_trailing_semicolon
START|   SplitQueries/multiple_queries_in_single_line
START|   SplitQueries/multiple_queries_in_multiple_lines
START|   SplitQueries/empty_string
PASS | SplitQueries (0.00s)
PASS |   SplitQueries/empty_input (0.00s)
PASS |   SplitQueries/only_semicolons (0.00s)
PASS |   SplitQueries/single_input (0.00s)
PASS |   SplitQueries/single_input_with_leading_semicolon (0.00s)
PASS |   SplitQueries/nil_input (0.00s)
PASS |   SplitQueries/string_with_only_semicolon (0.00s)
PASS |   SplitQueries/single_input_with_trailing_semicolon (0.00s)
PASS |   SplitQueries/multiple_queries_in_single_line (0.00s)
PASS |   SplitQueries/multiple_queries_in_multiple_lines (0.00s)
PASS |   SplitQueries/empty_string (0.00s)
START| UpdateUser_ChangePassword
START|   UpdateUser_ChangePassword/missing_username
START|   UpdateUser_ChangePassword/missing_password
START|   UpdateUser_ChangePassword/missing_username_and_password
START|   UpdateUser_ChangePassword/happy_path
START|   UpdateUser_ChangePassword/bad_statements
PASS | UpdateUser_ChangePassword (53.22s)
PASS |   UpdateUser_ChangePassword/missing_username (10.38s)
PASS |   UpdateUser_ChangePassword/missing_password (9.87s)
PASS |   UpdateUser_ChangePassword/missing_username_and_password (11.15s)
PASS |   UpdateUser_ChangePassword/happy_path (10.01s)
PASS |   UpdateUser_ChangePassword/bad_statements (11.81s)
PASS
PASS | github.com/hashicorp/vault-plugin-database-oracle 132.040s

Contributor Checklist

@pcman312 pcman312 requested review from tvoran and calvn October 26, 2020 19:54
Copy link
Member

@tvoran tvoran left a comment

Choose a reason for hiding this comment

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

Some minor things. It looks like there's opportunities to use the dbtesting functions in the tests. It also looks like there's some possibly now-outdated bits in creds.go and creds_test.go.

@pcman312 pcman312 requested a review from tvoran October 27, 2020 16:52
@pcman312 pcman312 merged commit 4882566 into master Oct 27, 2020
@pcman312 pcman312 deleted the dbv5 branch October 27, 2020 18:59
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