-
Notifications
You must be signed in to change notification settings - Fork 4
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 entity/entity alias primitives #41
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
320d23a
initial
403ba3b
basic
3d4a193
test passing
3adffc4
entity tests working
417b6ae
alias support
31af159
added alias tests
4fafa87
added alias methods
8a6a394
cleanup
b1215d4
comments
d8a4d74
lint
63f3411
Merge branch 'main' into addEntities
GeorgeJahad 0d441b3
review cleanup
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lint
- Loading branch information
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,30 +56,29 @@ class VaultTest < ActiveSupport::TestCase | |
@client.delete_entity(@entity_name) | ||
entity = @client.read_entity(@entity_name) | ||
assert_nil entity | ||
|
||
end | ||
|
||
test "#entity_alias" do | ||
#confirm no entity yet | ||
# confirm no entity yet | ||
err = assert_raises RuntimeError do | ||
@client.read_entity_alias(@entity_name, @alias_name) | ||
end | ||
assert_match /no such entity/, err.message | ||
|
||
#confirm no alias yet | ||
# confirm no alias yet | ||
@client.put_entity(@entity_name, @policies) | ||
err = assert_raises RuntimeError do | ||
@client.read_entity_alias(@entity_name, @alias_name) | ||
end | ||
assert_match /no such alias/, err.message | ||
|
||
#create alias | ||
# create alias | ||
auth_method = "token" | ||
@client.put_entity_alias(@entity_name, @alias_name, auth_method) | ||
entity_alias = @client.read_entity_alias(@entity_name, @alias_name) | ||
assert_equal entity_alias.data[:mount_type], auth_method | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think in general the first argument is the expectation, and the second is the actual being tested -- reversed here and in other test above. |
||
|
||
#confirm deleted alias | ||
# confirm deleted alias | ||
assert_equal @client.delete_entity_alias(@entity_name, @alias_name), true | ||
err = assert_raises RuntimeError do | ||
@client.delete_entity_alias(@entity_name, @alias_name) | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice