-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI: Align auth method ttl with tune value #26663
Merged
hellobontempo
merged 18 commits into
main
from
ui/VAULT-21112/align-auth-method-ttl-with-tune-value
Apr 30, 2024
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
05393ce
refactor findAll to use internal/ui/mounts when authenticated as well
hellobontempo cecbc97
format ttl in details view
hellobontempo 990aaf5
include hours in format for easy comparison to CLI return
hellobontempo 4d5729e
Revert "include hours in format for easy comparison to CLI return"
hellobontempo 7c55ef9
add changelog
hellobontempo efe2d3c
revert adapter change
hellobontempo 2124080
add new adapter method instead of updating existing
hellobontempo d04d1ba
add test for ttl
hellobontempo 931194f
revert and use findAll again
hellobontempo f5fb333
update mirage endpoints
hellobontempo a89ef29
Merge branch 'main' into ui/VAULT-21112/align-auth-method-ttl-with-tu…
hellobontempo 5181c5e
remove query obj
hellobontempo aa88b95
Revert "update mirage endpoints"
hellobontempo 7776c22
another one that snuck into a separate commit
hellobontempo cedabc0
use adapterOption to manage endpoint logic
hellobontempo 05b69b2
add adapter tests
hellobontempo a88f416
Update changelog/26663.txt
hellobontempo 4110aaf
add test that ttl inputs aren not checked
hellobontempo 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: Show computed values from `sys/internal/ui/mounts` endpoint for auth mount configuration view | ||
``` |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
|
||
module('Unit | Adapter | auth method', function (hooks) { | ||
setupTest(hooks); | ||
setupMirage(hooks); | ||
|
||
hooks.beforeEach(async function () { | ||
this.store = this.owner.lookup('service:store'); | ||
this.mockResponse = { | ||
data: { | ||
auth: { | ||
'approle/': { | ||
accessor: 'auth_approle_43e5a627', | ||
config: { | ||
default_lease_ttl: 2764800, | ||
force_no_cache: false, | ||
listing_visibility: 'hidden', | ||
max_lease_ttl: 2764800, | ||
token_type: 'default-service', | ||
}, | ||
uuid: '7a8bc146-76d0-3a9c-9feb-47a6713a85b3', | ||
}, | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
test('findAll makes request to correct endpoint with no adapterOptions', async function (assert) { | ||
assert.expect(1); | ||
|
||
this.server.get('sys/auth', () => { | ||
assert.ok(true, 'request made to sys/auth when no options are passed to findAll'); | ||
return { data: this.mockResponse.data.auth }; | ||
}); | ||
|
||
await this.store.findAll('auth-method'); | ||
}); | ||
|
||
test('findAll makes request to correct endpoint when unauthenticated is true', async function (assert) { | ||
assert.expect(1); | ||
|
||
this.server.get('sys/internal/ui/mounts', () => { | ||
assert.ok(true, 'request made to correct endpoint when unauthenticated'); | ||
return this.mockResponse; | ||
}); | ||
|
||
await this.store.findAll('auth-method', { adapterOptions: { unauthenticated: true } }); | ||
}); | ||
|
||
test('findAll makes request to correct endpoint when useMountsEndpoint is true', async function (assert) { | ||
assert.expect(1); | ||
|
||
this.server.get('sys/internal/ui/mounts', () => { | ||
assert.ok(true, 'request made to correct endpoint when useMountsEndpoint'); | ||
return this.mockResponse; | ||
}); | ||
|
||
await this.store.findAll('auth-method', { adapterOptions: { useMountsEndpoint: true } }); | ||
}); | ||
}); |
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.
cleanup suggestion: this might read a little cleaner as
async/await
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.
I prefer that syntax as well, but I think I'll leave it is to minimize changes in this PR. Which reminds me that I wanted to ask Finn if this should be backported.