mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	[UI] Types Linting (#29702)
* adds linting for types to scripts and lint staged * fixes issue with AdapterError type * moves lint-staged setup out of package.json and into config file * fixes ember data store service type * fixes route params types * fixes model types * fixes general type errors * fixes ts declaration errors in js files * adds missing copyright headers * fixes issue accessing capabilities model properties * ignores AdapterError import type error * more updates to AdapterError type * adds comment to lint-staged config * moves ember data store type to @ember-data namespace * updates store import * moves AdapterError type to @ember-data namespace * turns ember-data import eslint rule back on
This commit is contained in:
		| @@ -5,4 +5,4 @@ | |||||||
|  |  | ||||||
| import TransformBase from './transform-edit-base'; | import TransformBase from './transform-edit-base'; | ||||||
|  |  | ||||||
| export default class AlphabetEdit extends TransformBase {} | export default TransformBase; | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ | |||||||
| import Ember from 'ember'; | import Ember from 'ember'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| // ARG NOTE: Once you remove outer-html after glimmerizing you can remove the outer-html component | // ARG NOTE: Once you remove outer-html after glimmerizing you can remove the outer-html component | ||||||
| import Component from './outer-html'; | import Component from '@ember/component'; | ||||||
| import { task, timeout, waitForEvent } from 'ember-concurrency'; | import { task, timeout, waitForEvent } from 'ember-concurrency'; | ||||||
| import { debounce } from '@ember/runloop'; | import { debounce } from '@ember/runloop'; | ||||||
|  |  | ||||||
| @@ -17,6 +17,8 @@ const ERROR_JWT_LOGIN = 'OIDC login is not configured for this mount'; | |||||||
| export { ERROR_WINDOW_CLOSED, ERROR_MISSING_PARAMS, ERROR_JWT_LOGIN }; | export { ERROR_WINDOW_CLOSED, ERROR_MISSING_PARAMS, ERROR_JWT_LOGIN }; | ||||||
|  |  | ||||||
| export default Component.extend({ | export default Component.extend({ | ||||||
|  |   tagName: '', | ||||||
|  |  | ||||||
|   store: service(), |   store: service(), | ||||||
|   flagsService: service('flags'), |   flagsService: service('flags'), | ||||||
|  |  | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ export default class VerticalBarStacked extends Component<Args> { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   label(legendKey: string) { |   label(legendKey: string) { | ||||||
|     return this.args.chartLegend.find((l: Legend) => l.key === legendKey).label; |     return this.args.chartLegend.find((l: Legend) => l.key === legendKey)?.label; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   get chartData() { |   get chartData() { | ||||||
| @@ -136,7 +136,7 @@ export default class VerticalBarStacked extends Component<Args> { | |||||||
|  |  | ||||||
|   tooltipY = (original: number) => (!original ? '0' : `${original}`); |   tooltipY = (original: number) => (!original ? '0' : `${original}`); | ||||||
|  |  | ||||||
|   formatTicksX = (timestamp: string): string => parseAPITimestamp(timestamp, 'M/yy'); |   formatTicksX = (timestamp: string): string => parseAPITimestamp(timestamp, 'M/yy') as string; | ||||||
|  |  | ||||||
|   formatTicksY = (num: number): string => numericalAxisLabel(num) || num.toString(); |   formatTicksY = (num: number): string => numericalAxisLabel(num) || num.toString(); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -11,14 +11,15 @@ import { parseAPITimestamp } from 'core/utils/date-formatters'; | |||||||
| import { filteredTotalForMount, filterVersionHistory, TotalClients } from 'core/utils/client-count-utils'; | import { filteredTotalForMount, filterVersionHistory, TotalClients } from 'core/utils/client-count-utils'; | ||||||
| import { sanitizePath } from 'core/utils/sanitize-path'; | import { sanitizePath } from 'core/utils/sanitize-path'; | ||||||
|  |  | ||||||
| import type AdapterError from '@ember-data/adapter'; | import type AdapterError from '@ember-data/adapter/error'; | ||||||
| import type FlagsService from 'vault/services/flags'; | import type FlagsService from 'vault/services/flags'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
| import type ClientsActivityModel from 'vault/models/clients/activity'; | import type ClientsActivityModel from 'vault/models/clients/activity'; | ||||||
| import type ClientsConfigModel from 'vault/models/clients/config'; | import type ClientsConfigModel from 'vault/models/clients/config'; | ||||||
| import type ClientsVersionHistoryModel from 'vault/models/clients/version-history'; | import type ClientsVersionHistoryModel from 'vault/models/clients/version-history'; | ||||||
| import type NamespaceService from 'vault/services/namespace'; | import type NamespaceService from 'vault/services/namespace'; | ||||||
|  |  | ||||||
| interface Args { | interface Args { | ||||||
|   activity: ClientsActivityModel; |   activity: ClientsActivityModel; | ||||||
|   activityError?: AdapterError; |   activityError?: AdapterError; | ||||||
| @@ -35,7 +36,7 @@ export default class ClientsCountsPageComponent extends Component<Args> { | |||||||
|   @service declare readonly flags: FlagsService; |   @service declare readonly flags: FlagsService; | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|   @service declare readonly namespace: NamespaceService; |   @service declare readonly namespace: NamespaceService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|  |  | ||||||
|   get formattedStartDate() { |   get formattedStartDate() { | ||||||
|     return this.args.startTimestamp ? parseAPITimestamp(this.args.startTimestamp, 'MMMM yyyy') : null; |     return this.args.startTimestamp ? parseAPITimestamp(this.args.startTimestamp, 'MMMM yyyy') : null; | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ import { isAddonEngine, allEngines } from 'vault/helpers/mountable-secret-engine | |||||||
|  |  | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
|  | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| import type { AuthEnableModel } from 'vault/routes/vault/cluster/settings/auth/enable'; | import type { AuthEnableModel } from 'vault/routes/vault/cluster/settings/auth/enable'; | ||||||
| import type { MountSecretBackendModel } from 'vault/routes/vault/cluster/settings/mount-secret-backend'; | import type { MountSecretBackendModel } from 'vault/routes/vault/cluster/settings/mount-secret-backend'; | ||||||
| @@ -46,7 +47,7 @@ export default class MountBackendForm extends Component<Args> { | |||||||
|   @tracked modelValidations = null; |   @tracked modelValidations = null; | ||||||
|   @tracked invalidFormAlert = null; |   @tracked invalidFormAlert = null; | ||||||
|  |  | ||||||
|   @tracked errorMessage = ''; |   @tracked errorMessage: string | string[] = ''; | ||||||
|  |  | ||||||
|   willDestroy() { |   willDestroy() { | ||||||
|     // components are torn down after store is unloaded and will cause an error if attempt to unload record |     // components are torn down after store is unloaded and will cause an error if attempt to unload record | ||||||
| @@ -144,7 +145,9 @@ export default class MountBackendForm extends Component<Args> { | |||||||
|  |  | ||||||
|     try { |     try { | ||||||
|       yield mountModel.save(); |       yield mountModel.save(); | ||||||
|     } catch (err) { |     } catch (error) { | ||||||
|  |       const err = error as AdapterError; | ||||||
|  |  | ||||||
|       if (err.httpStatus === 403) { |       if (err.httpStatus === 403) { | ||||||
|         this.flashMessages.danger( |         this.flashMessages.danger( | ||||||
|           'You do not have access to the sys/mounts endpoint. The secret engine was not mounted.' |           'You do not have access to the sys/mounts endpoint. The secret engine was not mounted.' | ||||||
|   | |||||||
| @@ -1,16 +0,0 @@ | |||||||
| /** |  | ||||||
|  * Copyright (c) HashiCorp, Inc. |  | ||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| // THIS COMPONENT IS ONLY FOR EXTENDING |  | ||||||
| // You should use this component if you want to use outerHTML symantics |  | ||||||
| // in your components - this is the default for upcoming Glimmer components |  | ||||||
| import Component from '@ember/component'; |  | ||||||
|  |  | ||||||
| export default Component.extend({ |  | ||||||
|   tagName: '', |  | ||||||
| }); |  | ||||||
|  |  | ||||||
| // yep! that's it, it's more of a way to keep track of what components |  | ||||||
| // use tagless semantics to make the upgrade to glimmer components easier |  | ||||||
| @@ -15,6 +15,9 @@ import keys from 'core/utils/key-codes'; | |||||||
| const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root'; | const LIST_ROOT_ROUTE = 'vault.cluster.secrets.backend.list-root'; | ||||||
| const SHOW_ROUTE = 'vault.cluster.secrets.backend.show'; | const SHOW_ROUTE = 'vault.cluster.secrets.backend.show'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Component.extend(FocusOnInsertMixin, { | export default Component.extend(FocusOnInsertMixin, { | ||||||
|   router: service(), |   router: service(), | ||||||
|  |  | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ import type MountConfigModel from 'vault/vault/models/secret-engine/mount-config | |||||||
| import type AdditionalConfigModel from 'vault/vault/models/secret-engine/additional-config'; | import type AdditionalConfigModel from 'vault/vault/models/secret-engine/additional-config'; | ||||||
| import type IdentityOidcConfigModel from 'vault/models/identity/oidc/config'; | import type IdentityOidcConfigModel from 'vault/models/identity/oidc/config'; | ||||||
| import type Router from '@ember/routing/router'; | import type Router from '@ember/routing/router'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
|  |  | ||||||
| @@ -57,7 +57,7 @@ interface Args { | |||||||
|  |  | ||||||
| export default class ConfigureWif extends Component<Args> { | export default class ConfigureWif extends Component<Args> { | ||||||
|   @service declare readonly router: Router; |   @service declare readonly router: Router; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|   @service declare readonly flashMessages: FlashMessageService; |   @service declare readonly flashMessages: FlashMessageService; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,6 +27,9 @@ export const removeFromList = (list, itemToRemove) => { | |||||||
|   return newList.uniq(); |   return newList.uniq(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Component.extend(FocusOnInsertMixin, { | export default Component.extend(FocusOnInsertMixin, { | ||||||
|   store: service(), |   store: service(), | ||||||
|   flashMessages: service(), |   flashMessages: service(), | ||||||
|   | |||||||
| @@ -5,4 +5,4 @@ | |||||||
|  |  | ||||||
| import TransformationEdit from './transformation-edit'; | import TransformationEdit from './transformation-edit'; | ||||||
|  |  | ||||||
| export default TransformationEdit.extend({}); | export default TransformationEdit; | ||||||
|   | |||||||
| @@ -5,4 +5,4 @@ | |||||||
|  |  | ||||||
| import TransformBase from './transform-edit-base'; | import TransformBase from './transform-edit-base'; | ||||||
|  |  | ||||||
| export default TransformBase.extend({}); | export default TransformBase; | ||||||
|   | |||||||
| @@ -6,11 +6,12 @@ | |||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| import Controller from '@ember/controller'; | import Controller from '@ember/controller'; | ||||||
| import config from '../config/environment'; | import config from '../config/environment'; | ||||||
|  |  | ||||||
| import type AuthService from 'vault/vault/services/auth'; | import type AuthService from 'vault/vault/services/auth'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
|  |  | ||||||
| export default class ApplicationController extends Controller { | export default class ApplicationController extends Controller { | ||||||
|   @service declare readonly auth: AuthService; |   @service declare readonly auth: AuthService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   env = config.environment; |   env = config.environment; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -6,6 +6,9 @@ | |||||||
| import Controller from '@ember/controller'; | import Controller from '@ember/controller'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Controller.extend({ | export default Controller.extend({ | ||||||
|   router: service(), |   router: service(), | ||||||
|   showRoute: 'vault.cluster.access.identity.show', |   showRoute: 'vault.cluster.access.identity.show', | ||||||
|   | |||||||
| @@ -4,11 +4,11 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import keys from 'core/utils/key-codes'; | import keys from 'core/utils/key-codes'; | ||||||
| import AdapterError from '@ember-data/adapter/error'; |  | ||||||
| import { parse } from 'shell-quote'; | import { parse } from 'shell-quote'; | ||||||
|  |  | ||||||
| import argTokenizer from './arg-tokenizer'; | import argTokenizer from './arg-tokenizer'; | ||||||
| import { StringMap } from 'vault/vault/app-types'; |  | ||||||
|  | import type { StringMap } from 'vault/app-types'; | ||||||
|  | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| // Add new commands to `log-help` component for visibility | // Add new commands to `log-help` component for visibility | ||||||
| const supportedCommands = ['read', 'write', 'list', 'delete', 'kv-get']; | const supportedCommands = ['read', 'write', 'list', 'delete', 'kv-get']; | ||||||
| @@ -188,12 +188,7 @@ export function logFromResponse(response: LogResponse, path: string, method: str | |||||||
|   return { type: 'object', content: secret }; |   return { type: 'object', content: secret }; | ||||||
| } | } | ||||||
|  |  | ||||||
| interface CustomError extends AdapterError { | export function logFromError(error: AdapterError, vaultPath: string, method: string) { | ||||||
|   httpStatus: number; |  | ||||||
|   path: string; |  | ||||||
|   errors: string[]; |  | ||||||
| } |  | ||||||
| export function logFromError(error: CustomError, vaultPath: string, method: string) { |  | ||||||
|   let content; |   let content; | ||||||
|   const { httpStatus, path } = error; |   const { httpStatus, path } = error; | ||||||
|   const verbClause = { |   const verbClause = { | ||||||
|   | |||||||
| @@ -7,12 +7,14 @@ import Route from '@ember/routing/route'; | |||||||
| import { hash } from 'rsvp'; | import { hash } from 'rsvp'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
|  |  | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
|  |  | ||||||
| export default class ClientsRoute extends Route { | export default class ClientsRoute extends Route { | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|  |  | ||||||
|   getVersionHistory() { |   getVersionHistory(): Promise< | ||||||
|  |     Array<{ version: string; previousVersion: string; timestampInstalled: string }> | ||||||
|  |   > { | ||||||
|     return this.store |     return this.store | ||||||
|       .findAll('clients/version-history') |       .findAll('clients/version-history') | ||||||
|       .then((response) => { |       .then((response) => { | ||||||
|   | |||||||
| @@ -7,10 +7,10 @@ import Route from '@ember/routing/route'; | |||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| import { fromUnixTime } from 'date-fns'; | import { fromUnixTime } from 'date-fns'; | ||||||
|  |  | ||||||
| import type AdapterError from '@ember-data/adapter'; | import type AdapterError from '@ember-data/adapter/error'; | ||||||
| import type FlagsService from 'vault/services/flags'; | import type FlagsService from 'vault/services/flags'; | ||||||
| import type NamespaceService from 'vault/services/namespace'; | import type NamespaceService from 'vault/services/namespace'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
| import type { ModelFrom } from 'vault/vault/route'; | import type { ModelFrom } from 'vault/vault/route'; | ||||||
| import type ClientsRoute from '../clients'; | import type ClientsRoute from '../clients'; | ||||||
| @@ -35,7 +35,7 @@ export type ClientsCountsRouteModel = ModelFrom<ClientsCountsRoute>; | |||||||
| export default class ClientsCountsRoute extends Route { | export default class ClientsCountsRoute extends Route { | ||||||
|   @service declare readonly flags: FlagsService; |   @service declare readonly flags: FlagsService; | ||||||
|   @service declare readonly namespace: NamespaceService; |   @service declare readonly namespace: NamespaceService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|  |  | ||||||
|   queryParams = { |   queryParams = { | ||||||
| @@ -69,8 +69,8 @@ export default class ClientsCountsRoute extends Route { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async getActivity(params: ClientsCountsRouteParams): Promise<{ |   async getActivity(params: ClientsCountsRouteParams): Promise<{ | ||||||
|     activity: ClientsActivityModel; |     activity?: ClientsActivityModel; | ||||||
|     activityError: AdapterError; |     activityError?: AdapterError; | ||||||
|   }> { |   }> { | ||||||
|     let activity, activityError; |     let activity, activityError; | ||||||
|     // if CE without start time we want to skip the activity call |     // if CE without start time we want to skip the activity call | ||||||
| @@ -88,7 +88,7 @@ export default class ClientsCountsRoute extends Route { | |||||||
|       try { |       try { | ||||||
|         activity = await this.store.queryRecord('clients/activity', query); |         activity = await this.store.queryRecord('clients/activity', query); | ||||||
|       } catch (error) { |       } catch (error) { | ||||||
|         activityError = error; |         activityError = error as AdapterError; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     return { |     return { | ||||||
|   | |||||||
| @@ -9,6 +9,9 @@ | |||||||
| import Route from '@ember/routing/route'; | import Route from '@ember/routing/route'; | ||||||
| import ClusterRoute from 'vault/mixins/cluster-route'; | import ClusterRoute from 'vault/mixins/cluster-route'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Route.extend(ClusterRoute, { | export default Route.extend(ClusterRoute, { | ||||||
|   model() { |   model() { | ||||||
|     return this.modelFor('vault.cluster'); |     return this.modelFor('vault.cluster'); | ||||||
|   | |||||||
| @@ -5,4 +5,4 @@ | |||||||
|  |  | ||||||
| import ClusterRoute from './cluster-route-base'; | import ClusterRoute from './cluster-route-base'; | ||||||
|  |  | ||||||
| export default ClusterRoute.extend({}); | export default ClusterRoute; | ||||||
|   | |||||||
| @@ -8,6 +8,9 @@ import Route from '@ember/routing/route'; | |||||||
| import UnloadModelRoute from 'vault/mixins/unload-model-route'; | import UnloadModelRoute from 'vault/mixins/unload-model-route'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Route.extend(UnloadModelRoute, { | export default Route.extend(UnloadModelRoute, { | ||||||
|   router: service(), |   router: service(), | ||||||
|   store: service(), |   store: service(), | ||||||
|   | |||||||
| @@ -77,7 +77,8 @@ export default class SecretsBackendConfigurationEdit extends Route { | |||||||
|         } else { |         } else { | ||||||
|           model[standardizedKey] = configModel; |           model[standardizedKey] = configModel; | ||||||
|         } |         } | ||||||
|       } catch (e: AdapterError) { |       } catch (error) { | ||||||
|  |         const e = error as AdapterError; | ||||||
|         // For most models if the adapter returns a 404, we want to create a new record. |         // For most models if the adapter returns a 404, we want to create a new record. | ||||||
|         // The ssh secret engine however returns a 400 if the CA is not configured. |         // The ssh secret engine however returns a 400 if the CA is not configured. | ||||||
|         // For ssh's 400 error, we want to create the CA config model. |         // For ssh's 400 error, we want to create the CA config model. | ||||||
|   | |||||||
| @@ -11,6 +11,9 @@ import Route from '@ember/routing/route'; | |||||||
| import { encodePath, normalizePath } from 'vault/utils/path-encoding-helpers'; | import { encodePath, normalizePath } from 'vault/utils/path-encoding-helpers'; | ||||||
| import { keyIsFolder, parentKeyForKey } from 'core/utils/key-utils'; | import { keyIsFolder, parentKeyForKey } from 'core/utils/key-utils'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Route.extend({ | export default Route.extend({ | ||||||
|   store: service(), |   store: service(), | ||||||
|   router: service(), |   router: service(), | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ import { assert } from '@ember/debug'; | |||||||
|  |  | ||||||
| import type AdapterError from '@ember-data/adapter/error'; | import type AdapterError from '@ember-data/adapter/error'; | ||||||
| import type CapabilitiesModel from 'vault/vault/models/capabilities'; | import type CapabilitiesModel from 'vault/vault/models/capabilities'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
|  |  | ||||||
| interface Capabilities { | interface Capabilities { | ||||||
|   canCreate: boolean; |   canCreate: boolean; | ||||||
| @@ -25,7 +25,7 @@ interface MultipleCapabilities { | |||||||
| } | } | ||||||
|  |  | ||||||
| export default class CapabilitiesService extends Service { | export default class CapabilitiesService extends Service { | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|  |  | ||||||
|   async request(query: { paths?: string[]; path?: string }) { |   async request(query: { paths?: string[]; path?: string }) { | ||||||
|     if (query?.paths) { |     if (query?.paths) { | ||||||
| @@ -74,7 +74,7 @@ export default class CapabilitiesService extends Service { | |||||||
|     try { |     try { | ||||||
|       return this.request({ path }); |       return this.request({ path }); | ||||||
|     } catch (error) { |     } catch (error) { | ||||||
|       return error; |       return error as AdapterError; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -85,12 +85,12 @@ export default class CapabilitiesService extends Service { | |||||||
|   async _fetchSpecificCapability( |   async _fetchSpecificCapability( | ||||||
|     path: string, |     path: string, | ||||||
|     capability: string |     capability: string | ||||||
|   ): Promise<CapabilitiesModel> | AdapterError { |   ): Promise<CapabilitiesModel | AdapterError> { | ||||||
|     try { |     try { | ||||||
|       const capabilities = await this.request({ path }); |       const capabilities = await this.request({ path }); | ||||||
|       return capabilities[capability]; |       return capabilities[capability]; | ||||||
|     } catch (e) { |     } catch (e) { | ||||||
|       return e; |       return e as AdapterError; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -8,9 +8,11 @@ import { tracked } from '@glimmer/tracking'; | |||||||
| import { keepLatestTask } from 'ember-concurrency'; | import { keepLatestTask } from 'ember-concurrency'; | ||||||
| import { DEBUG } from '@glimmer/env'; | import { DEBUG } from '@glimmer/env'; | ||||||
| import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; | import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; | ||||||
| import type StoreService from 'vault/services/store'; |  | ||||||
|  | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
| import type PermissionsService from 'vault/services/permissions'; | import type PermissionsService from 'vault/services/permissions'; | ||||||
|  | import type CapabilitiesModel from 'vault/models/capabilities'; | ||||||
|  |  | ||||||
| const FLAGS = { | const FLAGS = { | ||||||
|   vaultCloudNamespace: 'VAULT_CLOUD_ADMIN_NAMESPACE', |   vaultCloudNamespace: 'VAULT_CLOUD_ADMIN_NAMESPACE', | ||||||
| @@ -24,7 +26,7 @@ const FLAGS = { | |||||||
|  |  | ||||||
| export default class flagsService extends Service { | export default class flagsService extends Service { | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly permissions: PermissionsService; |   @service declare readonly permissions: PermissionsService; | ||||||
|  |  | ||||||
|   @tracked activatedFlags: string[] = []; |   @tracked activatedFlags: string[] = []; | ||||||
| @@ -80,7 +82,8 @@ export default class flagsService extends Service { | |||||||
|     return this.getActivatedFlags.perform(); |     return this.getActivatedFlags.perform(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   @lazyCapabilities(apiPath`sys/activation-flags/secrets-sync/activate`) secretsSyncActivatePath; |   @lazyCapabilities(apiPath`sys/activation-flags/secrets-sync/activate`) | ||||||
|  |   declare secretsSyncActivatePath: CapabilitiesModel; | ||||||
|  |  | ||||||
|   get canActivateSecretsSync() { |   get canActivateSecretsSync() { | ||||||
|     return ( |     return ( | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ import { guidFor } from '@ember/object/internals'; | |||||||
| import { run } from '@ember/runloop'; | import { run } from '@ember/runloop'; | ||||||
| import { keyIsFolder, parentKeyForKey, keyWithoutParentKey } from 'core/utils/key-utils'; | import { keyIsFolder, parentKeyForKey, keyWithoutParentKey } from 'core/utils/key-utils'; | ||||||
|  |  | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type KvSecretMetadataModel from 'vault/models/kv/metadata'; | import type KvSecretMetadataModel from 'vault/models/kv/metadata'; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -49,7 +49,7 @@ interface PowerSelectAPI { | |||||||
| } | } | ||||||
|  |  | ||||||
| export default class KvSuggestionInputComponent extends Component<Args> { | export default class KvSuggestionInputComponent extends Component<Args> { | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|  |  | ||||||
|   @tracked secrets: KvSecretMetadataModel[] = []; |   @tracked secrets: KvSecretMetadataModel[] = []; | ||||||
|   powerSelectAPI: PowerSelectAPI | undefined; |   powerSelectAPI: PowerSelectAPI | undefined; | ||||||
|   | |||||||
| @@ -5,6 +5,9 @@ | |||||||
|  |  | ||||||
| import Component from '@ember/component'; | import Component from '@ember/component'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Component.extend({ | export default Component.extend({ | ||||||
|   onSubmit() {}, |   onSubmit() {}, | ||||||
|   replicationMode: null, |   replicationMode: null, | ||||||
|   | |||||||
| @@ -8,8 +8,8 @@ import Route from '@ember/routing/route'; | |||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type SecretMountPath from 'vault/services/secret-mount-path'; | import type SecretMountPath from 'vault/services/secret-mount-path'; | ||||||
| import type Transition from '@ember/routing/transition'; | import type Transition from '@ember/routing/transition'; | ||||||
| import type Model from '@ember-data/model'; | import type MountConfigModel from 'vault/models/mount-config'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * for use in routes that need to be aware of the config for a secrets engine |  * for use in routes that need to be aware of the config for a secrets engine | ||||||
| @@ -34,7 +34,7 @@ export function withConfig(modelName: string) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     return class FetchSecretsEngineConfig extends SuperClass { |     return class FetchSecretsEngineConfig extends SuperClass { | ||||||
|       configModel: Model | null = null; |       configModel: MountConfigModel | null = null; | ||||||
|       configError: AdapterError | null = null; |       configError: AdapterError | null = null; | ||||||
|       promptConfig = false; |       promptConfig = false; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -239,9 +239,7 @@ export const sortMonthsByTimestamp = (monthsArray: ActivityMonthBlock[]) => { | |||||||
| function monthIsEmpty(month: ActivityMonthBlock): month is ActivityMonthEmpty { | function monthIsEmpty(month: ActivityMonthBlock): month is ActivityMonthEmpty { | ||||||
|   return !month || month?.counts === null; |   return !month || month?.counts === null; | ||||||
| } | } | ||||||
| function monthWithoutNewCounts(month: ActivityMonthBlock): month is ActivityMonthNoNewClients { |  | ||||||
|   return month?.counts !== null && month?.new_clients?.counts === null; |  | ||||||
| } |  | ||||||
| function monthWithAllCounts(month: ActivityMonthBlock): month is ActivityMonthStandard { | function monthWithAllCounts(month: ActivityMonthBlock): month is ActivityMonthStandard { | ||||||
|   return month?.counts !== null && month?.new_clients?.counts !== null; |   return month?.counts !== null && month?.new_clients?.counts !== null; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ import errorMessage from 'vault/utils/error-message'; | |||||||
|  |  | ||||||
| import type LdapConfigModel from 'vault/models/ldap/config'; | import type LdapConfigModel from 'vault/models/ldap/config'; | ||||||
| import type SecretEngineModel from 'vault/models/secret-engine'; | import type SecretEngineModel from 'vault/models/secret-engine'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
| import type { Breadcrumb } from 'vault/vault/app-types'; | import type { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5,15 +5,12 @@ | |||||||
|  |  | ||||||
| import Component from '@glimmer/component'; | import Component from '@glimmer/component'; | ||||||
|  |  | ||||||
| import type { | import type { StaticCredentials, DynamicCredentials } from 'ldap/routes/roles/role/credentials'; | ||||||
|   LdapStaticRoleCredentials, |  | ||||||
|   LdapDynamicRoleCredentials, |  | ||||||
| } from 'ldap/routes/roles/role/credentials'; |  | ||||||
| import { Breadcrumb } from 'vault/vault/app-types'; | import { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| interface Args { | interface Args { | ||||||
|   credentials: LdapStaticRoleCredentials | LdapDynamicRoleCredentials; |   credentials: StaticCredentials | DynamicCredentials; | ||||||
|   error: AdapterError; |   error: AdapterError; | ||||||
|   breadcrumbs: Array<Breadcrumb>; |   breadcrumbs: Array<Breadcrumb>; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ import type LdapConfigModel from 'vault/models/ldap/config'; | |||||||
| import type SecretEngineModel from 'vault/models/secret-engine'; | import type SecretEngineModel from 'vault/models/secret-engine'; | ||||||
| import type Controller from '@ember/controller'; | import type Controller from '@ember/controller'; | ||||||
| import type { Breadcrumb } from 'vault/vault/app-types'; | import type { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| interface RouteModel { | interface RouteModel { | ||||||
|   backendModel: SecretEngineModel; |   backendModel: SecretEngineModel; | ||||||
| @@ -47,7 +47,7 @@ export default class LdapConfigurationRoute extends Route { | |||||||
|  |  | ||||||
|     controller.breadcrumbs = [ |     controller.breadcrumbs = [ | ||||||
|       { label: 'Secrets', route: 'secrets', linkExternal: true }, |       { label: 'Secrets', route: 'secrets', linkExternal: true }, | ||||||
|       { label: resolvedModel.backendModel.id, route: 'overview', model: resolvedModel.backend }, |       { label: resolvedModel.backendModel.id, route: 'overview', model: resolvedModel.backendModel.id }, | ||||||
|       { label: 'Configuration' }, |       { label: 'Configuration' }, | ||||||
|     ]; |     ]; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ import Route from '@ember/routing/route'; | |||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
|  |  | ||||||
| import type Transition from '@ember/routing/transition'; | import type Transition from '@ember/routing/transition'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
| import type SecretEngineModel from 'vault/models/secret-engine'; | import type SecretEngineModel from 'vault/models/secret-engine'; | ||||||
| import type { Breadcrumb } from 'vault/vault/app-types'; | import type { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import type Controller from '@ember/controller'; | import type Controller from '@ember/controller'; | ||||||
|   | |||||||
| @@ -51,7 +51,7 @@ export default class LdapLibrariesRoute extends Route { | |||||||
|  |  | ||||||
|     controller.breadcrumbs = [ |     controller.breadcrumbs = [ | ||||||
|       { label: 'Secrets', route: 'secrets', linkExternal: true }, |       { label: 'Secrets', route: 'secrets', linkExternal: true }, | ||||||
|       { label: resolvedModel.backendModel.id, route: 'overview', model: resolvedModel.backend }, |       { label: resolvedModel.backendModel.id, route: 'overview', model: resolvedModel.backendModel.id }, | ||||||
|       { label: 'Libraries' }, |       { label: 'Libraries' }, | ||||||
|     ]; |     ]; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ import type Store from '@ember-data/store'; | |||||||
| import type SecretMountPath from 'vault/services/secret-mount-path'; | import type SecretMountPath from 'vault/services/secret-mount-path'; | ||||||
|  |  | ||||||
| interface LdapLibraryRouteParams { | interface LdapLibraryRouteParams { | ||||||
|   name: string; |   name?: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default class LdapLibraryRoute extends Route { | export default class LdapLibraryRoute extends Route { | ||||||
|   | |||||||
| @@ -15,7 +15,6 @@ import type Controller from '@ember/controller'; | |||||||
| import type Transition from '@ember/routing/transition'; | import type Transition from '@ember/routing/transition'; | ||||||
| import type { Breadcrumb } from 'vault/vault/app-types'; | import type { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import { LdapLibraryCheckOutCredentials } from 'vault/vault/adapters/ldap/library'; | import { LdapLibraryCheckOutCredentials } from 'vault/vault/adapters/ldap/library'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports |  | ||||||
| import { ldapBreadcrumbs, libraryRoutes } from 'ldap/utils/ldap-breadcrumbs'; | import { ldapBreadcrumbs, libraryRoutes } from 'ldap/utils/ldap-breadcrumbs'; | ||||||
|  |  | ||||||
| interface LdapLibraryCheckOutController extends Controller { | interface LdapLibraryCheckOutController extends Controller { | ||||||
| @@ -36,7 +35,7 @@ export default class LdapLibraryCheckOutRoute extends Route { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   model(_params: object, transition: Transition) { |   model(_params: object, transition: Transition) { | ||||||
|     const ttl = transition.to?.queryParams['ttl']; |     const ttl = transition.to?.queryParams['ttl'] as string; | ||||||
|     const library = this.modelFor('libraries.library') as LdapLibraryModel; |     const library = this.modelFor('libraries.library') as LdapLibraryModel; | ||||||
|     return library.checkOutAccount(ttl); |     return library.checkOutAccount(ttl); | ||||||
|   } |   } | ||||||
| @@ -59,7 +58,7 @@ export default class LdapLibraryCheckOutRoute extends Route { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   @action |   @action | ||||||
|   error(error: AdapterError) { |   error(error: Error) { | ||||||
|     // if check-out fails, return to library details route |     // if check-out fails, return to library details route | ||||||
|     const message = errorMessage(error, 'Error checking out account. Please try again or contact support.'); |     const message = errorMessage(error, 'Error checking out account. Please try again or contact support.'); | ||||||
|     this.flashMessages.danger(message); |     this.flashMessages.danger(message); | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ export default class LdapRolesRoute extends Route { | |||||||
|   @service declare readonly pagination: PaginationService; |   @service declare readonly pagination: PaginationService; | ||||||
|   @service declare readonly secretMountPath: SecretMountPath; |   @service declare readonly secretMountPath: SecretMountPath; | ||||||
|  |  | ||||||
|   lazyQuery(backendId: string, params: { page?: string; pageFilter: string }, adapterOptions: object) { |   lazyQuery(backendId: string, params: { page?: string; pageFilter?: string }, adapterOptions: object) { | ||||||
|     const page = Number(params.page) || 1; |     const page = Number(params.page) || 1; | ||||||
|     return this.pagination.lazyPaginatedQuery( |     return this.pagination.lazyPaginatedQuery( | ||||||
|       'ldap/role', |       'ldap/role', | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ import { service } from '@ember/service'; | |||||||
| import { withConfig } from 'core/decorators/fetch-secrets-engine-config'; | import { withConfig } from 'core/decorators/fetch-secrets-engine-config'; | ||||||
| import { hash } from 'rsvp'; | import { hash } from 'rsvp'; | ||||||
|  |  | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type Transition from '@ember/routing/transition'; | import type Transition from '@ember/routing/transition'; | ||||||
| import type LdapRoleModel from 'vault/models/ldap/role'; | import type LdapRoleModel from 'vault/models/ldap/role'; | ||||||
| import type SecretEngineModel from 'vault/models/secret-engine'; | import type SecretEngineModel from 'vault/models/secret-engine'; | ||||||
| @@ -28,7 +28,7 @@ interface RouteController extends Controller { | |||||||
|  |  | ||||||
| @withConfig('ldap/config') | @withConfig('ldap/config') | ||||||
| export default class LdapRolesIndexRoute extends LdapRolesRoute { | export default class LdapRolesIndexRoute extends LdapRolesRoute { | ||||||
|   @service declare readonly store: StoreService; // necessary for @withConfig decorator |   @service declare readonly store: Store; // necessary for @withConfig decorator | ||||||
|  |  | ||||||
|   declare promptConfig: boolean; |   declare promptConfig: boolean; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ import type LdapRoleModel from 'vault/models/ldap/role'; | |||||||
| import type Controller from '@ember/controller'; | import type Controller from '@ember/controller'; | ||||||
| import type Transition from '@ember/routing/transition'; | import type Transition from '@ember/routing/transition'; | ||||||
| import type { Breadcrumb } from 'vault/vault/app-types'; | import type { Breadcrumb } from 'vault/vault/app-types'; | ||||||
| import type AdapterError from 'ember-data/adapter'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | import type AdapterError from '@ember-data/adapter/error'; | ||||||
|  |  | ||||||
| export interface StaticCredentials { | export interface StaticCredentials { | ||||||
|   dn: string; |   dn: string; | ||||||
|   | |||||||
| @@ -26,9 +26,9 @@ interface RouteController extends Controller { | |||||||
|  |  | ||||||
| interface RouteParams { | interface RouteParams { | ||||||
|   page?: string; |   page?: string; | ||||||
|   pageFilter: string; |   pageFilter?: string; | ||||||
|   path_to_role: string; |   path_to_role?: string; | ||||||
|   type: string; |   type?: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default class LdapRolesSubdirectoryRoute extends LdapRolesRoute { | export default class LdapRolesSubdirectoryRoute extends LdapRolesRoute { | ||||||
|   | |||||||
| @@ -10,7 +10,7 @@ import { tracked } from '@glimmer/tracking'; | |||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
| import type RouterService from '@ember/routing/router-service'; | import type RouterService from '@ember/routing/router-service'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type Store from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
|  |  | ||||||
| interface Args { | interface Args { | ||||||
|   | |||||||
| @@ -6,6 +6,7 @@ | |||||||
| import Component from '@glimmer/component'; | import Component from '@glimmer/component'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| import { tracked } from '@glimmer/tracking'; | import { tracked } from '@glimmer/tracking'; | ||||||
|  |  | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type RouterService from '@ember/routing/router'; | import type RouterService from '@ember/routing/router'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
|   | |||||||
| @@ -10,6 +10,7 @@ import { action } from '@ember/object'; | |||||||
| import { waitFor } from '@ember/test-waiters'; | import { waitFor } from '@ember/test-waiters'; | ||||||
| import { task } from 'ember-concurrency'; | import { task } from 'ember-concurrency'; | ||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
|  |  | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type RouterService from '@ember/routing/router'; | import type RouterService from '@ember/routing/router'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
|   | |||||||
| @@ -7,6 +7,7 @@ import Component from '@glimmer/component'; | |||||||
| import { action } from '@ember/object'; | import { action } from '@ember/object'; | ||||||
| import { tracked } from '@glimmer/tracking'; | import { tracked } from '@glimmer/tracking'; | ||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
|  |  | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type RouterService from '@ember/routing/router-service'; | import type RouterService from '@ember/routing/router-service'; | ||||||
| import type PkiIssuerModel from 'vault/models/pki/issuer'; | import type PkiIssuerModel from 'vault/models/pki/issuer'; | ||||||
|   | |||||||
| @@ -11,9 +11,10 @@ import { task } from 'ember-concurrency'; | |||||||
| import { waitFor } from '@ember/test-waiters'; | import { waitFor } from '@ember/test-waiters'; | ||||||
| import { expandAttributeMeta } from 'vault/utils/field-to-attrs'; | import { expandAttributeMeta } from 'vault/utils/field-to-attrs'; | ||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
|  |  | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type PkiActionModel from 'vault/models/pki/action'; | import type PkiActionModel from 'vault/models/pki/action'; | ||||||
| import type { ValidationMap } from 'vault/vault/app-types'; | import type { Model, ValidationMap } from 'vault/app-types'; | ||||||
|  |  | ||||||
| interface Args { | interface Args { | ||||||
|   model: PkiActionModel; |   model: PkiActionModel; | ||||||
| @@ -82,7 +83,7 @@ export default class PkiGenerateCsrComponent extends Component<Args> { | |||||||
|  |  | ||||||
|   @task |   @task | ||||||
|   @waitFor |   @waitFor | ||||||
|   *save(event: Event): Generator<Promise<boolean | PkiActionModel>> { |   *save(event: Event): Generator<Promise<boolean | Model>> { | ||||||
|     event.preventDefault(); |     event.preventDefault(); | ||||||
|     try { |     try { | ||||||
|       const { model, onSave } = this.args; |       const { model, onSave } = this.args; | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ import { task } from 'ember-concurrency'; | |||||||
| import { tracked } from '@glimmer/tracking'; | import { tracked } from '@glimmer/tracking'; | ||||||
| import { action } from '@ember/object'; | import { action } from '@ember/object'; | ||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
|  |  | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type SecretMountPathService from 'vault/services/secret-mount-path'; | import type SecretMountPathService from 'vault/services/secret-mount-path'; | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ import { task } from 'ember-concurrency'; | |||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| import { tracked } from '@glimmer/tracking'; | import { tracked } from '@glimmer/tracking'; | ||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
|  |  | ||||||
| import type RouterService from '@ember/routing/router'; | import type RouterService from '@ember/routing/router'; | ||||||
| import type Store from '@ember-data/store'; | import type Store from '@ember-data/store'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
|   | |||||||
| @@ -25,6 +25,9 @@ const DEFAULTS = { | |||||||
| }; | }; | ||||||
| const waiter = buildWaiter('replication-actions'); | const waiter = buildWaiter('replication-actions'); | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Controller.extend(structuredClone(DEFAULTS), { | export default Controller.extend(structuredClone(DEFAULTS), { | ||||||
|   isModalActive: false, |   isModalActive: false, | ||||||
|   isTokenCopied: false, |   isTokenCopied: false, | ||||||
|   | |||||||
| @@ -8,6 +8,9 @@ import { service } from '@ember/service'; | |||||||
| import Route from '@ember/routing/route'; | import Route from '@ember/routing/route'; | ||||||
| import UnloadModelRouteMixin from 'vault/mixins/unload-model-route'; | import UnloadModelRouteMixin from 'vault/mixins/unload-model-route'; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * @type Class | ||||||
|  |  */ | ||||||
| export default Route.extend(UnloadModelRouteMixin, { | export default Route.extend(UnloadModelRouteMixin, { | ||||||
|   router: service('app-router'), |   router: service('app-router'), | ||||||
|   store: service(), |   store: service(), | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ import errorMessage from 'vault/utils/error-message'; | |||||||
|  |  | ||||||
| import type SyncDestinationModel from 'vault/models/sync/destination'; | import type SyncDestinationModel from 'vault/models/sync/destination'; | ||||||
| import type RouterService from '@ember/routing/router-service'; | import type RouterService from '@ember/routing/router-service'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type PaginationService from 'vault/services/pagination'; | import type PaginationService from 'vault/services/pagination'; | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type { SearchSelectOption } from 'vault/vault/app-types'; | import type { SearchSelectOption } from 'vault/vault/app-types'; | ||||||
| @@ -24,7 +24,7 @@ interface Args { | |||||||
|  |  | ||||||
| export default class DestinationSyncPageComponent extends Component<Args> { | export default class DestinationSyncPageComponent extends Component<Args> { | ||||||
|   @service('app-router') declare readonly router: RouterService; |   @service('app-router') declare readonly router: RouterService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly flashMessages: FlashMessageService; |   @service declare readonly flashMessages: FlashMessageService; | ||||||
|   @service declare readonly pagination: PaginationService; |   @service declare readonly pagination: PaginationService; | ||||||
|  |  | ||||||
| @@ -56,7 +56,7 @@ export default class DestinationSyncPageComponent extends Component<Args> { | |||||||
|   async fetchMounts() { |   async fetchMounts() { | ||||||
|     try { |     try { | ||||||
|       const secretEngines = await this.store.query('secret-engine', {}); |       const secretEngines = await this.store.query('secret-engine', {}); | ||||||
|       this.mounts = secretEngines.reduce((filtered, model) => { |       this.mounts = secretEngines.reduce((filtered: SearchSelectOption[], model) => { | ||||||
|         if (model.type === 'kv' && model.version === 2) { |         if (model.type === 'kv' && model.version === 2) { | ||||||
|           filtered.push({ name: model.path, id: model.path }); |           filtered.push({ name: model.path, id: model.path }); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ import Ember from 'ember'; | |||||||
| import { DEBUG } from '@glimmer/env'; | import { DEBUG } from '@glimmer/env'; | ||||||
|  |  | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
| import type FlagsService from 'vault/services/flags'; | import type FlagsService from 'vault/services/flags'; | ||||||
| import type { SyncDestinationAssociationMetrics } from 'vault/vault/adapters/sync/association'; | import type { SyncDestinationAssociationMetrics } from 'vault/vault/adapters/sync/association'; | ||||||
| @@ -28,7 +28,7 @@ interface Args { | |||||||
|  |  | ||||||
| export default class SyncSecretsDestinationsPageComponent extends Component<Args> { | export default class SyncSecretsDestinationsPageComponent extends Component<Args> { | ||||||
|   @service declare readonly flashMessages: FlashMessageService; |   @service declare readonly flashMessages: FlashMessageService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|   @service declare readonly flags: FlagsService; |   @service declare readonly flags: FlagsService; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ import { waitFor } from '@ember/test-waiters'; | |||||||
| import errorMessage from 'vault/utils/error-message'; | import errorMessage from 'vault/utils/error-message'; | ||||||
|  |  | ||||||
| import type FlashMessageService from 'vault/services/flash-messages'; | import type FlashMessageService from 'vault/services/flash-messages'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type RouterService from '@ember/routing/router-service'; | import type RouterService from '@ember/routing/router-service'; | ||||||
|  |  | ||||||
| interface Args { | interface Args { | ||||||
| @@ -23,7 +23,7 @@ interface Args { | |||||||
|  |  | ||||||
| export default class SyncActivationModal extends Component<Args> { | export default class SyncActivationModal extends Component<Args> { | ||||||
|   @service declare readonly flashMessages: FlashMessageService; |   @service declare readonly flashMessages: FlashMessageService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service('app-router') declare readonly router: RouterService; |   @service('app-router') declare readonly router: RouterService; | ||||||
|  |  | ||||||
|   @tracked hasConfirmedDocs = false; |   @tracked hasConfirmedDocs = false; | ||||||
|   | |||||||
| @@ -7,15 +7,15 @@ import Route from '@ember/routing/route'; | |||||||
| import { service } from '@ember/service'; | import { service } from '@ember/service'; | ||||||
| import { findDestination } from 'core/helpers/sync-destinations'; | import { findDestination } from 'core/helpers/sync-destinations'; | ||||||
|  |  | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type { SyncDestinationType } from 'vault/vault/helpers/sync-destinations'; | import type { SyncDestinationType } from 'vault/vault/helpers/sync-destinations'; | ||||||
|  |  | ||||||
| interface Params { | interface Params { | ||||||
|   type: SyncDestinationType; |   type?: SyncDestinationType; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default class SyncSecretsDestinationsCreateDestinationRoute extends Route { | export default class SyncSecretsDestinationsCreateDestinationRoute extends Route { | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|  |  | ||||||
|   model(params: Params) { |   model(params: Params) { | ||||||
|     const { type } = params; |     const { type } = params; | ||||||
|   | |||||||
| @@ -13,8 +13,8 @@ import type Transition from '@ember/routing/transition'; | |||||||
| import type SyncDestinationModel from 'vault/models/sync/destination'; | import type SyncDestinationModel from 'vault/models/sync/destination'; | ||||||
|  |  | ||||||
| interface RouteParams { | interface RouteParams { | ||||||
|   name: string; |   name?: string; | ||||||
|   type: string; |   type?: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default class SyncSecretsDestinationsDestinationRoute extends Route { | export default class SyncSecretsDestinationsDestinationRoute extends Route { | ||||||
| @@ -23,7 +23,7 @@ export default class SyncSecretsDestinationsDestinationRoute extends Route { | |||||||
|   @service declare readonly flashMessages: FlashMessageService; |   @service declare readonly flashMessages: FlashMessageService; | ||||||
|  |  | ||||||
|   model(params: RouteParams) { |   model(params: RouteParams) { | ||||||
|     const { name, type } = params; |     const { name = '', type } = params; | ||||||
|     return this.store.findRecord(`sync/destinations/${type}`, name); |     return this.store.findRecord(`sync/destinations/${type}`, name); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -13,7 +13,7 @@ import type SyncAssociationModel from 'vault/vault/models/sync/association'; | |||||||
| import type Controller from '@ember/controller'; | import type Controller from '@ember/controller'; | ||||||
|  |  | ||||||
| interface SyncDestinationSecretsRouteParams { | interface SyncDestinationSecretsRouteParams { | ||||||
|   page: string; |   page?: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| interface SyncDestinationSecretsRouteModel { | interface SyncDestinationSecretsRouteModel { | ||||||
|   | |||||||
| @@ -14,9 +14,9 @@ import type SyncDestinationModel from 'vault/vault/models/sync/destination'; | |||||||
| import type Controller from '@ember/controller'; | import type Controller from '@ember/controller'; | ||||||
|  |  | ||||||
| interface SyncSecretsDestinationsIndexRouteParams { | interface SyncSecretsDestinationsIndexRouteParams { | ||||||
|   name: string; |   name?: string; | ||||||
|   type: string; |   type?: string; | ||||||
|   page: string; |   page?: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| interface SyncSecretsDestinationsRouteModel { | interface SyncSecretsDestinationsRouteModel { | ||||||
| @@ -71,7 +71,7 @@ export default class SyncSecretsDestinationsIndexRoute extends Route { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   async model(params: SyncSecretsDestinationsIndexRouteParams) { |   async model(params: SyncSecretsDestinationsIndexRouteParams) { | ||||||
|     const { name, type, page } = params; |     const { name = '', type = '', page } = params; | ||||||
|     return hash({ |     return hash({ | ||||||
|       destinations: this.pagination.lazyPaginatedQuery('sync/destination', { |       destinations: this.pagination.lazyPaginatedQuery('sync/destination', { | ||||||
|         page: Number(page) || 1, |         page: Number(page) || 1, | ||||||
|   | |||||||
| @@ -9,12 +9,12 @@ import { hash } from 'rsvp'; | |||||||
|  |  | ||||||
| import type FlagsService from 'vault/services/flags'; | import type FlagsService from 'vault/services/flags'; | ||||||
| import type RouterService from '@ember/routing/router-service'; | import type RouterService from '@ember/routing/router-service'; | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
| import type VersionService from 'vault/services/version'; | import type VersionService from 'vault/services/version'; | ||||||
|  |  | ||||||
| export default class SyncSecretsOverviewRoute extends Route { | export default class SyncSecretsOverviewRoute extends Route { | ||||||
|   @service('app-router') declare readonly router: RouterService; |   @service('app-router') declare readonly router: RouterService; | ||||||
|   @service declare readonly store: StoreService; |   @service declare readonly store: Store; | ||||||
|   @service declare readonly flags: FlagsService; |   @service declare readonly flags: FlagsService; | ||||||
|   @service declare readonly version: VersionService; |   @service declare readonly version: VersionService; | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								ui/lint-staged.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								ui/lint-staged.config.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | |||||||
|  | /* eslint-env node */ | ||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | // defining config here rather than in package.json to run tsc on all .ts files, not just the staged changes | ||||||
|  | // this is accomplished by using function syntax rather than string | ||||||
|  |  | ||||||
|  | module.exports = { | ||||||
|  |   '*.{js,ts}': ['prettier --config .prettierrc.js --write', 'eslint --quiet', () => 'tsc --noEmit'], | ||||||
|  |   '*.hbs': ['prettier --config .prettierrc.js --write', 'ember-template-lint --quiet'], | ||||||
|  |   '*.scss': ['prettier --write'], | ||||||
|  | }; | ||||||
| @@ -22,6 +22,7 @@ | |||||||
|     "lint:js": "eslint . --cache", |     "lint:js": "eslint . --cache", | ||||||
|     "lint:js:quiet": "eslint . --cache --quiet", |     "lint:js:quiet": "eslint . --cache --quiet", | ||||||
|     "lint:js:fix": "eslint . --fix", |     "lint:js:fix": "eslint . --fix", | ||||||
|  |     "lint:types": "tsc --noEmit", | ||||||
|     "fmt": "concurrently -c \"auto\" -n fmt: \"yarn:fmt:*\"", |     "fmt": "concurrently -c \"auto\" -n fmt: \"yarn:fmt:*\"", | ||||||
|     "fmt:js": "prettier --config .prettierrc.js --write '{app,tests,config,lib}/**/*.js'", |     "fmt:js": "prettier --config .prettierrc.js --write '{app,tests,config,lib}/**/*.js'", | ||||||
|     "fmt:hbs": "prettier --config .prettierrc.js --write '**/*.hbs'", |     "fmt:hbs": "prettier --config .prettierrc.js --write '**/*.hbs'", | ||||||
| @@ -29,8 +30,8 @@ | |||||||
|     "start": "VAULT_ADDR=http://127.0.0.1:8200; ember server --proxy=$VAULT_ADDR", |     "start": "VAULT_ADDR=http://127.0.0.1:8200; ember server --proxy=$VAULT_ADDR", | ||||||
|     "start2": "ember server --proxy=http://127.0.0.1:8202 --port=4202", |     "start2": "ember server --proxy=http://127.0.0.1:8202 --port=4202", | ||||||
|     "start:chroot": "ember server --proxy=http://127.0.0.1:8300 --port=4300", |     "start:chroot": "ember server --proxy=http://127.0.0.1:8300 --port=4300", | ||||||
|     "test": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,vault \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/start-vault.js {@}\" --", |     "test": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,lint:types,vault \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"yarn:lint:types\" \"node scripts/start-vault.js {@}\" --", | ||||||
|     "test:enos": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,enos \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/enos-test-ember.js {@}\" --", |     "test:enos": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,lint:types,enos \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"yarn:lint:types\" \"node scripts/enos-test-ember.js {@}\" --", | ||||||
|     "test:oss": "yarn run test -f='!enterprise'", |     "test:oss": "yarn run test -f='!enterprise'", | ||||||
|     "test:ent": "node scripts/start-vault.js -f='enterprise'", |     "test:ent": "node scripts/start-vault.js -f='enterprise'", | ||||||
|     "test:quick": "node scripts/start-vault.js --split=8 --preserve-test-name --parallel", |     "test:quick": "node scripts/start-vault.js --split=8 --preserve-test-name --parallel", | ||||||
| @@ -39,22 +40,6 @@ | |||||||
|     "vault": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8200 vault server -log-level=error -dev -dev-root-token-id=root -dev-ha -dev-transactional", |     "vault": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8200 vault server -log-level=error -dev -dev-root-token-id=root -dev-ha -dev-transactional", | ||||||
|     "vault:cluster": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8202 vault server -log-level=error -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8202 -dev-ha -dev-transactional" |     "vault:cluster": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8202 vault server -log-level=error -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8202 -dev-ha -dev-transactional" | ||||||
|   }, |   }, | ||||||
|   "lint-staged": { |  | ||||||
|     "*.js": [ |  | ||||||
|       "prettier --config .prettierrc.js --write", |  | ||||||
|       "eslint --quiet", |  | ||||||
|       "git add" |  | ||||||
|     ], |  | ||||||
|     "*.hbs": [ |  | ||||||
|       "prettier --config .prettierrc.js --write", |  | ||||||
|       "ember-template-lint --quiet", |  | ||||||
|       "git add" |  | ||||||
|     ], |  | ||||||
|     "*.scss": [ |  | ||||||
|       "prettier --write", |  | ||||||
|       "git add" |  | ||||||
|     ] |  | ||||||
|   }, |  | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "@babel/cli": "^7.24.6", |     "@babel/cli": "^7.24.6", | ||||||
|     "@babel/core": "^7.23.2", |     "@babel/core": "^7.23.2", | ||||||
| @@ -78,6 +63,7 @@ | |||||||
|     "@lineal-viz/lineal": "^0.5.1", |     "@lineal-viz/lineal": "^0.5.1", | ||||||
|     "@tsconfig/ember": "^2.0.0", |     "@tsconfig/ember": "^2.0.0", | ||||||
|     "@types/d3-array": "^3.2.1", |     "@types/d3-array": "^3.2.1", | ||||||
|  |     "@types/ember-data": "^4.4.16", | ||||||
|     "@types/qunit": "^2.19.4", |     "@types/qunit": "^2.19.4", | ||||||
|     "@types/rsvp": "^4.0.4", |     "@types/rsvp": "^4.0.4", | ||||||
|     "@types/shell-quote": "^1.7.1", |     "@types/shell-quote": "^1.7.1", | ||||||
|   | |||||||
| @@ -3,13 +3,13 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import type StoreService from 'vault/services/store'; | import type Store from '@ember-data/store'; | ||||||
|  |  | ||||||
| export const PKI_BASE_URL = `/vault/cluster/secrets/backend/pki/roles`; | export const PKI_BASE_URL = `/vault/cluster/secrets/backend/pki/roles`; | ||||||
|  |  | ||||||
| // Clears pki-related data and capabilities so that admin | // Clears pki-related data and capabilities so that admin | ||||||
| // capabilities from setup don't rollover | // capabilities from setup don't rollover | ||||||
| export function clearRecords(store: StoreService) { | export function clearRecords(store: Store) { | ||||||
|   store.unloadAll('pki/action'); |   store.unloadAll('pki/action'); | ||||||
|   store.unloadAll('pki/issuer'); |   store.unloadAll('pki/issuer'); | ||||||
|   store.unloadAll('pki/key'); |   store.unloadAll('pki/key'); | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								ui/types/@ember-data/adapter/error.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								ui/types/@ember-data/adapter/error.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | import Error from 'ember-data/adapter/errors'; | ||||||
|  |  | ||||||
|  | export type ApiError = string | { [key: string]: unknown; title?: string; message?: string }; | ||||||
|  |  | ||||||
|  | export default class AdapterError extends Error { | ||||||
|  |   httpStatus: number; | ||||||
|  |   path: string; | ||||||
|  |   message: string; | ||||||
|  |   errors: ApiError[]; | ||||||
|  |   data?: { | ||||||
|  |     [key: string]: unknown; | ||||||
|  |     error?: string; | ||||||
|  |   }; | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								ui/types/@ember-data/store.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								ui/types/@ember-data/store.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | import Store from 'ember-data/store'; | ||||||
|  |  | ||||||
|  | export default Store; | ||||||
| @@ -30,7 +30,3 @@ export default interface AdapterRegistry { | |||||||
|   application: Application; |   application: Application; | ||||||
|   [key: keyof ModelRegistry]: Adapter; |   [key: keyof ModelRegistry]: Adapter; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default interface AdapterError extends Error { |  | ||||||
|   httpStatus: number; |  | ||||||
| } |  | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								ui/types/ember-data/types/registries/model.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								ui/types/ember-data/types/registries/model.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -8,19 +8,29 @@ import KvSecretDataModel from 'vault/models/kv/data'; | |||||||
| import KvSecretMetadataModel from 'vault/models/kv/metadata'; | import KvSecretMetadataModel from 'vault/models/kv/metadata'; | ||||||
| import PkiActionModel from 'vault/models/pki/action'; | import PkiActionModel from 'vault/models/pki/action'; | ||||||
| import PkiCertificateGenerateModel from 'vault/models/pki/certificate/generate'; | import PkiCertificateGenerateModel from 'vault/models/pki/certificate/generate'; | ||||||
|  | import PkiConfigAcmeModel from 'vault/models/pki/config/acme'; | ||||||
|  | import PkiConfigClusterModel from 'vault/models/pki/config/cluster'; | ||||||
|  | import PkiConfigCrlModel from 'vault/models/pki/config/crl'; | ||||||
|  | import PkiConfigUrlsModel from 'vault/models/pki/config/urls'; | ||||||
| import ClientsActivityModel from 'vault/models/clients/activity'; | import ClientsActivityModel from 'vault/models/clients/activity'; | ||||||
| import ClientsConfigModel from 'vault/models/clients/config'; | import ClientsConfigModel from 'vault/models/clients/config'; | ||||||
| import ClientsVersionHistoryModel from 'vault/models/clients/version-history'; | import ClientsVersionHistoryModel from 'vault/models/clients/version-history'; | ||||||
|  | import CaConfigModel from 'vault/models/ssh/ca-config'; | ||||||
|  |  | ||||||
| declare module 'ember-data/types/registries/model' { | declare module 'ember-data/types/registries/model' { | ||||||
|   export default interface ModelRegistry { |   export default interface ModelRegistry { | ||||||
|     'pki/action': PkiActionModel; |     'pki/action': PkiActionModel; | ||||||
|     'pki/certificate/generate': PkiCertificateGenerateModel; |     'pki/certificate/generate': PkiCertificateGenerateModel; | ||||||
|  |     'pki/config/acme': PkiConfigAcmeModel; | ||||||
|  |     'pki/config/cluster': PkiConfigClusterModel; | ||||||
|  |     'pki/config/crl': PkiConfigCrlModel; | ||||||
|  |     'pki/config/urls': PkiConfigUrlModel; | ||||||
|     'kv/data': KvSecretDataModel; |     'kv/data': KvSecretDataModel; | ||||||
|     'kv/metadata': KvSecretMetadataModel; |     'kv/metadata': KvSecretMetadataModel; | ||||||
|     'clients/activity': ClientsActivityModel; |     'clients/activity': ClientsActivityModel; | ||||||
|     'clients/config': ClientsConfigModel; |     'clients/config': ClientsConfigModel; | ||||||
|     'clients/version-history': ClientsVersionHistoryModel; |     'clients/version-history': ClientsVersionHistoryModel; | ||||||
|  |     'ssh/ca-config': CaConfigModel; | ||||||
|     // Catchall for any other models |     // Catchall for any other models | ||||||
|     [key: string]: any; |     [key: string]: any; | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
|  * Copyright (c) HashiCorp, Inc. |  * Copyright (c) HashiCorp, Inc. | ||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
| import type EmberDataModel from '@ember-data/model'; | import type EmberDataModel from 'ember-data/model'; // eslint-disable-line ember/use-ember-data-rfc-395-imports | ||||||
| import type Owner from '@ember/owner'; | import type Owner from '@ember/owner'; | ||||||
|  |  | ||||||
| // Type that comes back from expandAttributeMeta | // Type that comes back from expandAttributeMeta | ||||||
| @@ -43,22 +43,24 @@ export interface ModelValidations { | |||||||
|   invalidFormMessage: string; |   invalidFormMessage: string; | ||||||
| } | } | ||||||
|  |  | ||||||
| export interface Model extends Omit<EmberDataModel, 'isNew'> { | export type Model = Omit<EmberDataModel, 'isNew'> & { | ||||||
|   // override isNew which is a computed prop and ts will complain since it sees it as a function |   // override isNew which is a computed prop and ts will complain since it sees it as a function | ||||||
|   isNew: boolean; |   isNew: boolean; | ||||||
| } | }; | ||||||
|  |  | ||||||
| export interface WithFormFieldsModel extends Model { | export type WithFormFieldsModel = Model & { | ||||||
|   formFields: Array<FormField>; |   formFields: Array<FormField>; | ||||||
|   formFieldGroups: FormFieldGroups; |   formFieldGroups: FormFieldGroups; | ||||||
|   allFields: Array<FormField>; |   allFields: Array<FormField>; | ||||||
| } | }; | ||||||
|  |  | ||||||
| export interface WithValidationsModel extends Model { | export type WithValidationsModel = Model & { | ||||||
|   validate(): ModelValidations; |   validate(): ModelValidations; | ||||||
| } | }; | ||||||
|  |  | ||||||
| export interface WithFormFieldsAndValidationsModel extends WithFormFieldsModel, WithValidationsModel {} | export type WithFormFieldsAndValidationsModel = WithFormFieldsModel & { | ||||||
|  |   validate(): ModelValidations; | ||||||
|  | }; | ||||||
|  |  | ||||||
| export interface Breadcrumb { | export interface Breadcrumb { | ||||||
|   label: string; |   label: string; | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								ui/types/vault/models/capabilities.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								ui/types/vault/models/capabilities.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -4,9 +4,9 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import ComputedProperty from '@ember/object/computed'; | import ComputedProperty from '@ember/object/computed'; | ||||||
| import Model from '@ember-data/model'; | import { Model } from 'vault/app-types'; | ||||||
|  |  | ||||||
| interface CapabilitiesModel extends Model { | type CapabilitiesModel = Model & { | ||||||
|   path: string; |   path: string; | ||||||
|   capabilities: Array<string>; |   capabilities: Array<string>; | ||||||
|   canCreate: ComputedProperty<boolean | undefined>; |   canCreate: ComputedProperty<boolean | undefined>; | ||||||
| @@ -20,7 +20,7 @@ interface CapabilitiesModel extends Model { | |||||||
|   // inferring type from key name |   // inferring type from key name | ||||||
|   allowedParameters: Array<string>; |   allowedParameters: Array<string>; | ||||||
|   deniedParameters: Array<string>; |   deniedParameters: Array<string>; | ||||||
| } | }; | ||||||
|  |  | ||||||
| export default CapabilitiesModel; | export default CapabilitiesModel; | ||||||
| export const SUDO_PATHS: string[]; | export const SUDO_PATHS: string[]; | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								ui/types/vault/models/mount-config.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								ui/types/vault/models/mount-config.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -15,4 +15,5 @@ export default class MountConfigModel extends Model { | |||||||
|   allowedResponseHeaders: string; |   allowedResponseHeaders: string; | ||||||
|   tokenType: string; |   tokenType: string; | ||||||
|   allowedManagedKeys: string; |   allowedManagedKeys: string; | ||||||
|  |   identityTokenKey: string; | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								ui/types/vault/models/pki/action.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								ui/types/vault/models/pki/action.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,11 +3,10 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { StringMap, WithFormFieldsAndValidationsModel } from 'vault/app-types'; | ||||||
| import { FormField, ModelValidations, StringMap } from 'vault/app-types'; | import type CapabilitiesModel from '../capabilities'; | ||||||
| import CapabilitiesModel from '../capabilities'; |  | ||||||
|  |  | ||||||
| export default class PkiActionModel extends Model { | type PkiActionModel = WithFormFieldsAndValidationsModel & { | ||||||
|   secretMountPath: unknown; |   secretMountPath: unknown; | ||||||
|   actionType: string | null; |   actionType: string | null; | ||||||
|   pemBundle: string; |   pemBundle: string; | ||||||
| @@ -51,11 +50,11 @@ export default class PkiActionModel extends Model { | |||||||
|   generateIssuerRootPath: Promise<CapabilitiesModel>; |   generateIssuerRootPath: Promise<CapabilitiesModel>; | ||||||
|   generateIssuerCsrPath: Promise<CapabilitiesModel>; |   generateIssuerCsrPath: Promise<CapabilitiesModel>; | ||||||
|   crossSignPath: string; |   crossSignPath: string; | ||||||
|   allFields: Array<FormField>; |  | ||||||
|   validate(): ModelValidations; |  | ||||||
|   // Capabilities |   // Capabilities | ||||||
|   get canImportBundle(): boolean; |   get canImportBundle(): boolean; | ||||||
|   get canGenerateIssuerRoot(): boolean; |   get canGenerateIssuerRoot(): boolean; | ||||||
|   get canGenerateIssuerIntermediate(): boolean; |   get canGenerateIssuerIntermediate(): boolean; | ||||||
|   get canCrossSign(): boolean; |   get canCrossSign(): boolean; | ||||||
| } | }; | ||||||
|  |  | ||||||
|  | export default PkiActionModel; | ||||||
|   | |||||||
| @@ -3,8 +3,9 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { WithFormFieldsAndValidationsModel } from 'vault/app-types'; | ||||||
| export default class PkiCertificateBaseModel extends Model { |  | ||||||
|  | type PkiCertificateBaseModel = WithFormFieldsAndValidationsModel & { | ||||||
|   secretMountPath: class; |   secretMountPath: class; | ||||||
|   get backend(): string; |   get backend(): string; | ||||||
|   altNames: string; |   altNames: string; | ||||||
| @@ -24,4 +25,6 @@ export default class PkiCertificateBaseModel extends Model { | |||||||
|   revocationTime: number; |   revocationTime: number; | ||||||
|   serialNumber: string; |   serialNumber: string; | ||||||
|   get canRevoke(): boolean; |   get canRevoke(): boolean; | ||||||
| } | }; | ||||||
|  |  | ||||||
|  | export default PkiCertificateBaseModel; | ||||||
|   | |||||||
| @@ -3,11 +3,10 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import { FormField, FormFieldGroups } from 'vault/app-types'; | import type PkiCertificateBaseModel from './base'; | ||||||
| import PkiCertificateBaseModel from './base'; |  | ||||||
|  |  | ||||||
| export default class PkiCertificateGenerateModel extends PkiCertificateBaseModel { | type PkiCertificateGenerateModel = PkiCertificateBaseModel & { | ||||||
|   role: string; |   role: string; | ||||||
|   formFields: FormField[]; | }; | ||||||
|   formFieldGroups: FormFieldGroups; |  | ||||||
| } | export default PkiCertificateGenerateModel; | ||||||
|   | |||||||
| @@ -3,13 +3,11 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import PkiCertificateBaseModel from './base'; | import type PkiCertificateBaseModel from './base'; | ||||||
| import { FormField, FormFieldGroups, ModelValidations } from 'vault/app-types'; |  | ||||||
| export default class PkiCertificateSignIntermediateModel extends PkiCertificateBaseModel { | type PkiCertificateSignIntermediateModel = PkiCertificateBaseModel & { | ||||||
|   role: string; |   role: string; | ||||||
|   csr: string; |   csr: string; | ||||||
|   formFields: FormField[]; |  | ||||||
|   formFieldGroups: FormFieldGroups; |  | ||||||
|   issuerRef: string; |   issuerRef: string; | ||||||
|   maxPathLength: string; |   maxPathLength: string; | ||||||
|   notBeforeDuration: string; |   notBeforeDuration: string; | ||||||
| @@ -18,5 +16,6 @@ export default class PkiCertificateSignIntermediateModel extends PkiCertificateB | |||||||
|   usePss: boolean; |   usePss: boolean; | ||||||
|   skid: string; |   skid: string; | ||||||
|   signatureBits: string; |   signatureBits: string; | ||||||
|   validate(): ModelValidations; | }; | ||||||
| } |  | ||||||
|  | export default PkiCertificateSignIntermediateModel; | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								ui/types/vault/models/pki/certificate/sign.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								ui/types/vault/models/pki/certificate/sign.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,13 +3,12 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import PkiCertificateBaseModel from './base'; | import type PkiCertificateBaseModel from './base'; | ||||||
| import { FormField, FormFieldGroups, ModelValidations } from 'vault/app-types'; |  | ||||||
| export default class PkiCertificateSignModel extends PkiCertificateBaseModel { | export type PkiCertificateSignModel = PkiCertificateBaseModel & { | ||||||
|   role: string; |   role: string; | ||||||
|   csr: string; |   csr: string; | ||||||
|   formFields: FormField[]; |  | ||||||
|   formFieldGroups: FormFieldGroups; |  | ||||||
|   removeRootsFromChain: boolean; |   removeRootsFromChain: boolean; | ||||||
|   validate(): ModelValidations; | }; | ||||||
| } |  | ||||||
|  | export default PkiCertificateSignModel; | ||||||
|   | |||||||
							
								
								
									
										22
									
								
								ui/types/vault/models/pki/config/acme.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								ui/types/vault/models/pki/config/acme.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | import type { Model } from 'vault/app-types'; | ||||||
|  | import type CapabilitiesModel from 'vault/models/capabilities'; | ||||||
|  |  | ||||||
|  | type PkiConfigAcmeModel = Model & { | ||||||
|  |   enabled: boolean; | ||||||
|  |   defaultDirectoryPolicy: string; | ||||||
|  |   allowedRoles: string[]; | ||||||
|  |   allowRoleExtKeyUsage: boolean; | ||||||
|  |   allowedIssuers: string[]; | ||||||
|  |   eabPolicy: string; | ||||||
|  |   dnsResolver: string; | ||||||
|  |   maxTtl: string; | ||||||
|  |   acmePath: CapabilitiesModel; | ||||||
|  |   get canSet(): boolean; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | export default PkiConfigAcmeModel; | ||||||
							
								
								
									
										16
									
								
								ui/types/vault/models/pki/config/cluster.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								ui/types/vault/models/pki/config/cluster.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | import type { Model } from 'vault/app-types'; | ||||||
|  | import type CapabilitiesModel from 'vault/models/capabilities'; | ||||||
|  |  | ||||||
|  | type PkiConfigClusterModel = Model & { | ||||||
|  |   path: boolean; | ||||||
|  |   aiaPath: string; | ||||||
|  |   clusterPath: CapabilitiesModel; | ||||||
|  |   get canSet(): boolean; | ||||||
|  | }; | ||||||
|  |  | ||||||
|  | export default PkiConfigClusterModel; | ||||||
							
								
								
									
										10
									
								
								ui/types/vault/models/pki/config/crl.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								ui/types/vault/models/pki/config/crl.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,10 +3,9 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { WithFormFieldsModel } from 'vault/app-types'; | ||||||
| import { FormField } from 'vault/app-types'; |  | ||||||
|  |  | ||||||
| export default class PkiConfigCrlModel extends Model { | type PkiConfigCrlModel = WithFormFieldsModel & { | ||||||
|   autoRebuild: boolean; |   autoRebuild: boolean; | ||||||
|   autoRebuildGracePeriod: string; |   autoRebuildGracePeriod: string; | ||||||
|   enableDelta: boolean; |   enableDelta: boolean; | ||||||
| @@ -16,6 +15,7 @@ export default class PkiConfigCrlModel extends Model { | |||||||
|   ocspExpiry: string; |   ocspExpiry: string; | ||||||
|   ocspDisable: boolean; |   ocspDisable: boolean; | ||||||
|   crlPath: string; |   crlPath: string; | ||||||
|   formFields: FormField[]; |  | ||||||
|   get canSet(): boolean; |   get canSet(): boolean; | ||||||
| } | }; | ||||||
|  |  | ||||||
|  | export default PkiConfigCrlModel; | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								ui/types/vault/models/pki/config/urls.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								ui/types/vault/models/pki/config/urls.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,12 +3,14 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { Model } from 'vault/app-types'; | ||||||
|  |  | ||||||
| export default class PkiConfigUrlsModel extends Model { | type PkiConfigUrlsModel = Model & { | ||||||
|   issuingCertificates: array; |   issuingCertificates: array; | ||||||
|   crlDistributionPoints: array; |   crlDistributionPoints: array; | ||||||
|   ocspServers: array; |   ocspServers: array; | ||||||
|   urlsPath: string; |   urlsPath: string; | ||||||
|   get canSet(): boolean; |   get canSet(): boolean; | ||||||
| } | }; | ||||||
|  |  | ||||||
|  | export default PkiConfigUrlsModel; | ||||||
|   | |||||||
							
								
								
									
										28
									
								
								ui/types/vault/models/pki/issuer.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								ui/types/vault/models/pki/issuer.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -2,11 +2,11 @@ | |||||||
|  * Copyright (c) HashiCorp, Inc. |  * Copyright (c) HashiCorp, Inc. | ||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  | import type { WithFormFieldsAndValidationsModel } from 'vault/app-types'; | ||||||
|  | import type { ParsedCertificateData } from 'vault/utils/parse-pki-cert'; | ||||||
|  | import type CapabilitiesModel from 'vault/models/capabilities'; | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | type PkiIssuerModel = WithFormFieldsAndValidationsModel & { | ||||||
| import { FormField, FormFieldGroups, ModelValidations } from 'vault/app-types'; |  | ||||||
| import { ParsedCertificateData } from 'vault/vault/utils/parse-pki-cert'; |  | ||||||
| export default class PkiIssuerModel extends Model { |  | ||||||
|   secretMountPath: class; |   secretMountPath: class; | ||||||
|   get backend(): string; |   get backend(): string; | ||||||
|   get issuerRef(): string; |   get issuerRef(): string; | ||||||
| @@ -22,22 +22,18 @@ export default class PkiIssuerModel extends Model { | |||||||
|   crlDistributionPoints: string; |   crlDistributionPoints: string; | ||||||
|   ocspServers: string; |   ocspServers: string; | ||||||
|   parsedCertificate: ParsedCertificateData; |   parsedCertificate: ParsedCertificateData; | ||||||
|   /** these are all instances of the capabilities model which should be converted to native class and typed |   rotateExported: CapabilitiesModel; | ||||||
|   rotateExported: any; |   rotateInternal: CapabilitiesModel; | ||||||
|   rotateInternal: any; |   rotateExisting: CapabilitiesModel; | ||||||
|   rotateExisting: any; |   crossSignPath: CapabilitiesModel; | ||||||
|   crossSignPath: any; |   signIntermediate: CapabilitiesModel; | ||||||
|   signIntermediate: any; |  | ||||||
|   -------------------- **/ |  | ||||||
|   pemBundle: string; |   pemBundle: string; | ||||||
|   importedIssuers: string[]; |   importedIssuers: string[]; | ||||||
|   importedKeys: string[]; |   importedKeys: string[]; | ||||||
|   formFields: FormField[]; |  | ||||||
|   formFieldGroups: FormFieldGroups[]; |  | ||||||
|   allFields: FormField[]; |  | ||||||
|   get canRotateIssuer(): boolean; |   get canRotateIssuer(): boolean; | ||||||
|   get canCrossSign(): boolean; |   get canCrossSign(): boolean; | ||||||
|   get canSignIntermediate(): boolean; |   get canSignIntermediate(): boolean; | ||||||
|   get canConfigure(): boolean; |   get canConfigure(): boolean; | ||||||
|   validate(): ModelValidations; | }; | ||||||
| } |  | ||||||
|  | export default PkiIssuerModel; | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								ui/types/vault/models/pki/key.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								ui/types/vault/models/pki/key.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,10 +3,9 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { WithValidationsModel } from 'vault/app-types'; | ||||||
| import { ModelValidations } from 'vault/app-types'; |  | ||||||
|  |  | ||||||
| export default class PkiKeyModel extends Model { | type PkiKeyModel = WithValidationsModel & { | ||||||
|   secretMountPath: class; |   secretMountPath: class; | ||||||
|   keyId: string; |   keyId: string; | ||||||
|   keyName: string; |   keyName: string; | ||||||
| @@ -15,12 +14,12 @@ export default class PkiKeyModel extends Model { | |||||||
|   keyBits: string; |   keyBits: string; | ||||||
|   pemBundle: string; |   pemBundle: string; | ||||||
|   privateKey: string; |   privateKey: string; | ||||||
|   isNew: boolean; |  | ||||||
|   get backend(): string; |   get backend(): string; | ||||||
|   get canRead(): boolean; |   get canRead(): boolean; | ||||||
|   get canEdit(): boolean; |   get canEdit(): boolean; | ||||||
|   get canDelete(): boolean; |   get canDelete(): boolean; | ||||||
|   get canGenerateKey(): boolean; |   get canGenerateKey(): boolean; | ||||||
|   get canImportKey(): boolean; |   get canImportKey(): boolean; | ||||||
|   validate(): ModelValidations; | }; | ||||||
| } |  | ||||||
|  | export default PkiKeyModel; | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								ui/types/vault/models/pki/role.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								ui/types/vault/models/pki/role.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,14 +3,13 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { WithValidationsModel } from 'vault/app-types'; | ||||||
| import { ModelValidations } from 'vault/app-types'; |  | ||||||
|  |  | ||||||
| export default class PkiRoleModel extends Model { | type PkiRoleModel = WithValidationsModel & { | ||||||
|   name: string; |   name: string; | ||||||
|   issuerRef: string; |   issuerRef: string; | ||||||
|   validate(): ModelValidations; |  | ||||||
|   isNew: boolean; |  | ||||||
|   keyType: string; |   keyType: string; | ||||||
|   keyBits: string | undefined; |   keyBits: string | undefined; | ||||||
| } | }; | ||||||
|  |  | ||||||
|  | export default PkiRoleModel; | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								ui/types/vault/models/pki/tidy.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								ui/types/vault/models/pki/tidy.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -3,10 +3,9 @@ | |||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| import Model from '@ember-data/model'; | import type { FormField, FormFieldGroups, WithFormFieldsModel } from 'vault/app-types'; | ||||||
| import { FormField, FormFieldGroups } from 'vault/vault/app-types'; |  | ||||||
|  |  | ||||||
| export default class PkiTidyModel extends Model { | type PkiTidyModel = WithFormFieldsModel & { | ||||||
|   version: string; |   version: string; | ||||||
|   acmeAccountSafetyBuffer: string; |   acmeAccountSafetyBuffer: string; | ||||||
|   tidyAcme: boolean; |   tidyAcme: boolean; | ||||||
| @@ -29,7 +28,7 @@ export default class PkiTidyModel extends Model { | |||||||
|   allByKey: { |   allByKey: { | ||||||
|     intervalDuration: FormField[]; |     intervalDuration: FormField[]; | ||||||
|   }; |   }; | ||||||
|   get allGroups(): FormFieldGroups[]; |  | ||||||
|   get sharedFields(): FormFieldGroups[]; |   get sharedFields(): FormFieldGroups[]; | ||||||
|   get formFieldGroups(): FormFieldGroups[]; | }; | ||||||
| } |  | ||||||
|  | export default PkiTidyModel; | ||||||
|   | |||||||
							
								
								
									
										17
									
								
								ui/types/vault/models/ssh/ca-config.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ui/types/vault/models/ssh/ca-config.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | /** | ||||||
|  |  * Copyright (c) HashiCorp, Inc. | ||||||
|  |  * SPDX-License-Identifier: BUSL-1.1 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | import { FormField, WithFormFieldsAndValidationsModel } from 'vault/app-types'; | ||||||
|  |  | ||||||
|  | export default interface SshCaConfig extends WithFormFieldsAndValidationsModel { | ||||||
|  |   backend: string; | ||||||
|  |   privateKey: string; | ||||||
|  |   publicKey: string; | ||||||
|  |   generateSigningKey: boolean; | ||||||
|  |  | ||||||
|  |   configurableParams: ['privateKey', 'publicKey', 'generateSigningKey']; | ||||||
|  |  | ||||||
|  |   get displayAttrs(): FormField[]; | ||||||
|  | } | ||||||
							
								
								
									
										14
									
								
								ui/types/vault/services/store.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								ui/types/vault/services/store.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -1,14 +0,0 @@ | |||||||
| /** |  | ||||||
|  * Copyright (c) HashiCorp, Inc. |  | ||||||
|  * SPDX-License-Identifier: BUSL-1.1 |  | ||||||
|  */ |  | ||||||
|  |  | ||||||
| import Store from '@ember-data/store'; |  | ||||||
|  |  | ||||||
| export default class StoreService extends Store { |  | ||||||
|   adapterFor(modelName: string); |  | ||||||
|   createRecord(modelName: string, object); |  | ||||||
|   findRecord(modelName: string, path: string); |  | ||||||
|   peekRecord(modelName: string, path: string); |  | ||||||
|   query(modelName: string, query: object); |  | ||||||
| } |  | ||||||
							
								
								
									
										200
									
								
								ui/yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										200
									
								
								ui/yarn.lock
									
									
									
									
									
								
							| @@ -1967,7 +1967,7 @@ __metadata: | |||||||
|   languageName: node |   languageName: node | ||||||
|   linkType: hard |   linkType: hard | ||||||
|  |  | ||||||
| "@glimmer/component@npm:^1.1.2": | "@glimmer/component@npm:^1.1.0, @glimmer/component@npm:^1.1.2": | ||||||
|   version: 1.1.2 |   version: 1.1.2 | ||||||
|   resolution: "@glimmer/component@npm:1.1.2" |   resolution: "@glimmer/component@npm:1.1.2" | ||||||
|   dependencies: |   dependencies: | ||||||
| @@ -3062,6 +3062,201 @@ __metadata: | |||||||
|   languageName: node |   languageName: node | ||||||
|   linkType: hard |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember-data@npm:^4.4.16": | ||||||
|  |   version: 4.4.16 | ||||||
|  |   resolution: "@types/ember-data@npm:4.4.16" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/ember__error": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/rsvp": "*" | ||||||
|  |   checksum: 7edbc8cd27d440e63b179df010064a580fa8c0b18b03f4efc091599848cb82bab266ea704947c5038d35b17d65b0f64d88a3de9cb1328466c1a35da6da2c5f08 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember@npm:*": | ||||||
|  |   version: 4.0.11 | ||||||
|  |   resolution: "@types/ember@npm:4.0.11" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__application": "*" | ||||||
|  |     "@types/ember__array": "*" | ||||||
|  |     "@types/ember__component": "*" | ||||||
|  |     "@types/ember__controller": "*" | ||||||
|  |     "@types/ember__debug": "*" | ||||||
|  |     "@types/ember__engine": "*" | ||||||
|  |     "@types/ember__error": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/ember__polyfills": "*" | ||||||
|  |     "@types/ember__routing": "*" | ||||||
|  |     "@types/ember__runloop": "*" | ||||||
|  |     "@types/ember__service": "*" | ||||||
|  |     "@types/ember__string": "*" | ||||||
|  |     "@types/ember__template": "*" | ||||||
|  |     "@types/ember__test": "*" | ||||||
|  |     "@types/ember__utils": "*" | ||||||
|  |     "@types/rsvp": "*" | ||||||
|  |   checksum: cda022b2f439f20a60d0834f592459722819654cb48c8f6f3661ad64b3efc8230844f1b112b29995bac44e62b6c95a2caf1f0f330f0df9d56a141dcac6f2b7ca | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__application@npm:*": | ||||||
|  |   version: 4.0.11 | ||||||
|  |   resolution: "@types/ember__application@npm:4.0.11" | ||||||
|  |   dependencies: | ||||||
|  |     "@glimmer/component": ^1.1.0 | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/ember__engine": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/ember__owner": "*" | ||||||
|  |     "@types/ember__routing": "*" | ||||||
|  |   checksum: ba9e913fd2d965f205923817cbdef1353cf05c496c76d6179f75af041b9a4fd0368f5dd96adfeb8df97bc398bfb34073cfd1c1a33bb10e63f065a2150b98c9ef | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__array@npm:*": | ||||||
|  |   version: 4.0.10 | ||||||
|  |   resolution: "@types/ember__array@npm:4.0.10" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |   checksum: 3ec77e13466c130d1af8c468e4a8d33a35060ea89bbd7fdcaf48650f2a88e0a5cdfa3fd15a62e780531f0937e7115635600d6b7cd486398087391f5c900f5934 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__component@npm:*": | ||||||
|  |   version: 4.0.22 | ||||||
|  |   resolution: "@types/ember__component@npm:4.0.22" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |   checksum: ef2b7141ca6dabbc311158a253ce6184d56ad691cb6fb22b0ff8f2ac0109fb4f929deef66ef56cf40a1b069cc52d23a1a6e3d511cab56fb29302b6be848e8259 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__controller@npm:*": | ||||||
|  |   version: 4.0.12 | ||||||
|  |   resolution: "@types/ember__controller@npm:4.0.12" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |   checksum: 02001690069e1e537fc92d84d2de103693e499bc2c7ba12597a454aa7c45b7d1b93092232c44601d06915f28240ec189eb1ca0aaec139ebf39dd63e6b42b197b | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__debug@npm:*": | ||||||
|  |   version: 4.0.8 | ||||||
|  |   resolution: "@types/ember__debug@npm:4.0.8" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/ember__owner": "*" | ||||||
|  |   checksum: a379664f6de9c63e37c6d834185e0609a7ee3e7993650912bf0a02c51770b94818b86fa7928b80f7df3b32e4cdcc5344917da65341d66d0950599ad11656e5a4 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__engine@npm:*": | ||||||
|  |   version: 4.0.11 | ||||||
|  |   resolution: "@types/ember__engine@npm:4.0.11" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/ember__owner": "*" | ||||||
|  |   checksum: 55a2fc9eb82f64e5d87d74b0624198b0ae898389ec5bb5ff845234aa60e4c8d72ccfe99bec449b3edd3f236f38d1ad5f07e64bb1daf9aacd0441a86041b4d56a | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__error@npm:*": | ||||||
|  |   version: 4.0.6 | ||||||
|  |   resolution: "@types/ember__error@npm:4.0.6" | ||||||
|  |   checksum: 8433d8960925ac59870f8152b32e9e2ee31fdcb89d2446d268a40fa68bd7551dc8cf168ff6d1dce66b56ad36a877c77e3c53da337259b76afc04b8553c995c84 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__object@npm:*": | ||||||
|  |   version: 4.0.12 | ||||||
|  |   resolution: "@types/ember__object@npm:4.0.12" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/rsvp": "*" | ||||||
|  |   checksum: 0c17e20b59e0c530be61cd539a01845aecebabb3750c0e2b5ca6af5118b3ddbffe75bedeaa1d279a19cbc216e1b6085207c130bf5c0cc9a172a354eb034c13d3 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__owner@npm:*": | ||||||
|  |   version: 4.0.9 | ||||||
|  |   resolution: "@types/ember__owner@npm:4.0.9" | ||||||
|  |   checksum: b8e7aad0dac031e240f78b5b263e295da3d7450d6e4a76054be95b9e23e091edc4d7d728d098999722c7500616f33275d02f5b5c3095aa5f5b4c0d81e6052311 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__polyfills@npm:*": | ||||||
|  |   version: 4.0.6 | ||||||
|  |   resolution: "@types/ember__polyfills@npm:4.0.6" | ||||||
|  |   checksum: 331d2dd66d106ffd67866d20186da1d6321080692de174bc7f61618735228f67ae41bc435c79fbce9532bd0a63d3489f73843edefe555f63021d28ee70fb0ea8 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__routing@npm:*": | ||||||
|  |   version: 4.0.22 | ||||||
|  |   resolution: "@types/ember__routing@npm:4.0.22" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |     "@types/ember__controller": "*" | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |     "@types/ember__service": "*" | ||||||
|  |   checksum: 377ec37cc2e7062ae4d5423d056957825b7116fb749b55f505d9dce8c1e0affb330c4249c6db97eb76f0c738f1b45711e90a78c0d9af245015f8a8bfa9f6971c | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__runloop@npm:*": | ||||||
|  |   version: 4.0.10 | ||||||
|  |   resolution: "@types/ember__runloop@npm:4.0.10" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |   checksum: 9a25acc53969640324ef14b0802a57b1b34ba45d2bea4653d401be691c134584ccb43807218784ea8bcf4efcf680f941dc015bda9a8d63f13ed8f7fa4c4ed15a | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__service@npm:*": | ||||||
|  |   version: 4.0.9 | ||||||
|  |   resolution: "@types/ember__service@npm:4.0.9" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__object": "*" | ||||||
|  |   checksum: 1459e93f13a019a5d824349642aa39b7b7e1ddb6970f04592076b2c1f2027a98f43acf5bda20874cfe45821f8731e982abeff0f09bed6f00bdc468ba1ee28dfd | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__string@npm:*": | ||||||
|  |   version: 3.16.3 | ||||||
|  |   resolution: "@types/ember__string@npm:3.16.3" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__template": "*" | ||||||
|  |   checksum: ee5998efc58c663dd316743ed91b1e0242321ccb79b83e2eae666e33570df8533a1ee25311ba156ec077ef63a8cbaadcf66d58cc440b86787e7a5f8e19f9f529 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__template@npm:*": | ||||||
|  |   version: 4.0.7 | ||||||
|  |   resolution: "@types/ember__template@npm:4.0.7" | ||||||
|  |   checksum: 6641c12dc0d33d9dcf0d67306e42acbc3c9cca0d6c21d93d0c616eafa89a0ebb35f8253dc9bf6eeced3a84e3222f8b4f64bdf69de294e5a3e53e03ea414feac4 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__test@npm:*": | ||||||
|  |   version: 4.0.6 | ||||||
|  |   resolution: "@types/ember__test@npm:4.0.6" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember__application": "*" | ||||||
|  |   checksum: aeea4a6b9f716e6205f2c7334f1047c2ed88573279d3b6fa6bf23780031ceaaa5f97bb9bf9f589b50dc77807d78d5fb868b727be34a8bb15bc673b5c5f6318a5 | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
|  | "@types/ember__utils@npm:*": | ||||||
|  |   version: 4.0.7 | ||||||
|  |   resolution: "@types/ember__utils@npm:4.0.7" | ||||||
|  |   dependencies: | ||||||
|  |     "@types/ember": "*" | ||||||
|  |   checksum: b14162ae496771afa41bbc2edf301edee62a52a43408c3c2b98337f8417ad47d187a205ab5235e11679af2002432f5bf447096ecdbc5e3a9b0b3aa163a1f603d | ||||||
|  |   languageName: node | ||||||
|  |   linkType: hard | ||||||
|  |  | ||||||
| "@types/eslint@npm:^8.4.2, @types/eslint@npm:^8.4.9": | "@types/eslint@npm:^8.4.2, @types/eslint@npm:^8.4.9": | ||||||
|   version: 8.56.12 |   version: 8.56.12 | ||||||
|   resolution: "@types/eslint@npm:8.56.12" |   resolution: "@types/eslint@npm:8.56.12" | ||||||
| @@ -3302,7 +3497,7 @@ __metadata: | |||||||
|   languageName: node |   languageName: node | ||||||
|   linkType: hard |   linkType: hard | ||||||
|  |  | ||||||
| "@types/rsvp@npm:^4.0.4": | "@types/rsvp@npm:*, @types/rsvp@npm:^4.0.4": | ||||||
|   version: 4.0.9 |   version: 4.0.9 | ||||||
|   resolution: "@types/rsvp@npm:4.0.9" |   resolution: "@types/rsvp@npm:4.0.9" | ||||||
|   checksum: 2c93a5bab22bd0ecfb6ecc238ca1e7e1dd0dff870d63eb63670d33148112f9d66b0af832e5c31cc0aa6534ab916092938a9b64072377070832808b7b36283a27 |   checksum: 2c93a5bab22bd0ecfb6ecc238ca1e7e1dd0dff870d63eb63670d33148112f9d66b0af832e5c31cc0aa6534ab916092938a9b64072377070832808b7b36283a27 | ||||||
| @@ -18174,6 +18369,7 @@ __metadata: | |||||||
|     "@lineal-viz/lineal": ^0.5.1 |     "@lineal-viz/lineal": ^0.5.1 | ||||||
|     "@tsconfig/ember": ^2.0.0 |     "@tsconfig/ember": ^2.0.0 | ||||||
|     "@types/d3-array": ^3.2.1 |     "@types/d3-array": ^3.2.1 | ||||||
|  |     "@types/ember-data": ^4.4.16 | ||||||
|     "@types/qunit": ^2.19.4 |     "@types/qunit": ^2.19.4 | ||||||
|     "@types/rsvp": ^4.0.4 |     "@types/rsvp": ^4.0.4 | ||||||
|     "@types/shell-quote": ^1.7.1 |     "@types/shell-quote": ^1.7.1 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jordan Reimer
					Jordan Reimer