mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
update header assertion (#27439)
This commit is contained in:
parent
e315ef31ec
commit
c7aaa69a27
1 changed files with 2 additions and 10 deletions
|
|
@ -64,12 +64,8 @@ module('Integration | Component | tools/wrap', function (hooks) {
|
|||
|
||||
this.server.post('sys/wrapping/wrap', (schema, { requestBody, requestHeaders }) => {
|
||||
const payload = JSON.parse(requestBody);
|
||||
const expectedHeaders = {
|
||||
'X-Vault-Wrap-TTL': '30m',
|
||||
'content-type': 'application/json; charset=utf-8',
|
||||
};
|
||||
assert.propEqual(payload, JSON.parse(this.wrapData), `payload contains data: ${requestBody}`);
|
||||
assert.propEqual(requestHeaders, expectedHeaders, 'header has default wrap ttl');
|
||||
assert.strictEqual(requestHeaders['X-Vault-Wrap-TTL'], '30m', 'request header has default wrap ttl');
|
||||
return {
|
||||
wrap_info: {
|
||||
token: this.token,
|
||||
|
|
@ -95,12 +91,8 @@ module('Integration | Component | tools/wrap', function (hooks) {
|
|||
assert.expect(2);
|
||||
this.server.post('sys/wrapping/wrap', (schema, { requestBody, requestHeaders }) => {
|
||||
const payload = JSON.parse(requestBody);
|
||||
const expectedHeaders = {
|
||||
'X-Vault-Wrap-TTL': '1200s',
|
||||
'content-type': 'application/json; charset=utf-8',
|
||||
};
|
||||
assert.propEqual(payload, JSON.parse(this.wrapData), `payload contains data: ${requestBody}`);
|
||||
assert.propEqual(requestHeaders, expectedHeaders, 'header has updated wrap ttl');
|
||||
assert.strictEqual(requestHeaders['X-Vault-Wrap-TTL'], '1200s', 'request header has updated wrap ttl');
|
||||
// only testing payload/header assertions, no need for return here
|
||||
return {};
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue