mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-25 16:41:08 +02:00
* Add helper combineOpenApiAttrs + test * hydrateModel working with upgradeModelSchema * new registerNewModelWithAttrs method for generated models * Add newFields to generated models * copyright * Glimmerize path-help service * update generated-item-list adapter and path-help usage of it * remove unused methods combineAttributes and combineFields * move expandOpenApiProps to ts helper file * fix auth test * fix bug where adding user to second userpass mount saves to first mount * Add mutableId * fix ent test * remove addressed deprecation * Address PR comments * [VAULT-31208] remove deprecation early-static from decorator tests
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { click, fillIn, visit } from '@ember/test-helpers';
|
|
import VAULT_KEYS from 'vault/tests/helpers/vault-keys';
|
|
import { AUTH_FORM } from 'vault/tests/helpers/auth/auth-form-selectors';
|
|
|
|
const { rootToken } = VAULT_KEYS;
|
|
|
|
export const login = async (token = rootToken) => {
|
|
// make sure we're always logged out and logged back in
|
|
await logout();
|
|
await visit('/vault/auth?with=token');
|
|
await fillIn(AUTH_FORM.input('token'), token);
|
|
return click(AUTH_FORM.login);
|
|
};
|
|
|
|
export const loginNs = async (ns: string, token = rootToken) => {
|
|
// make sure we're always logged out and logged back in
|
|
await logout();
|
|
await visit('/vault/auth?with=token');
|
|
await fillIn(AUTH_FORM.namespaceInput, ns);
|
|
await fillIn(AUTH_FORM.input('token'), token);
|
|
return click(AUTH_FORM.login);
|
|
};
|
|
|
|
export const logout = async () => {
|
|
// make sure we're always logged out and logged back in
|
|
await visit('/vault/logout');
|
|
// clear session storage to ensure we have a clean state
|
|
window.localStorage.clear();
|
|
return;
|
|
};
|