mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 07:01:09 +02:00
* UI: [VAULT-21521] Initial config-ui engine and routes set up (#23922) * UI: [VAULT-21526] Create adapter, serializer, and model files (#23947) * UI: [VAULT-21588] Add Custom Messages to the sidebar (#23946) * UI: [VAULT-21527] Mirage setup (#24000) * UI: [VAULT-21530] Custom Messages List View w/ Pagination and LazyPaginatedQuery (#24133) * UI: Add list to adapter query param (#24187) * UI: [VAULT-21532] Create message (#24407) * WIP create message * Add breadcrumns * Create and edit form * Add save to create/edit form * Add cancel and todo * Fix cancel route * Fix breadcrumb label to be title case * add start time logic * Update breadcrumb * Fix breadcrumbs and merge conflict test * Update create form description * Fix sidenav so it always highlights * Fix up forms * Mostly working create form * Form cleanup * Fix link title and href form fields * Default startTime * Fix messages * Update dropdown to use the updated ConfirmAction component * Update create and edit form * Add wip tests * Fix breadcrumb formatter * Comment out test * Update create message test * Update more tests * Add comment for fixing date on edit * Update Message form * Code cleanup! * Add validation tests * Remove authenticated from route model * SOme more code cleanup * Add controller so authenticated is parsed * Working radio buttons * Use an object instead of arrays * Wip date form * Fix license headers * Fix license headers addition of files * Fix copyright format issues and clean up code * Fix tests * Rename FormField radio getter and ay11 improvements * Address feedback * Fix specific date so it remembers the values * Address feedback! * Update more form fields * Use formfield action instead * Update to every * Update syntax of onchange * Fix tests * Update willDestroy so it doesnt break tests * Remove set and brodcast datetimelocal * Put FormField back the way it was in favor of putting FormField to a seperate PR * Remove getter in formfield component file * Address more feedback * Put back test * Update datetime string format var name and location * UI: [VAULT-21534 VAULT-21533 VAULT-21536] edit, preview, and delete custom message (#24603) * Working edit * VAULT-21536 update delete message and create/update flash message * VAULT-21533 add preview modal * Update serializer * Preview refinements * Move preview to its own component * Move breadcrumbs to setupController * Add more tests * Address some feedback * Address more feedback! * Update serailizer * Remove stylesheet * Add comment * UI: [VAULT-21435] Message details (#24645) * WIP * Fix timezone bug * Fix date issues on create/edit form * Add details screen * Use allFields instead of formFields * Fix tests * Address comments! * UI: VAULT-21538 unauth endpoint message display (#24665) * WIP unauth display * Add modal custom message * Close multiple modals * Update todo with ticket number * On init make custom message request * Use serializer * Update fetchMessages * Add copyright headers * Add services and serializers * Send null instead of empty strings * Fix tests! * Add copywrite headers * Add some acceptance tests * Test cleanup * Put tests back * pass hooks to module * Move module out * Seperate tests * Copywrite * Add aria-prohibited-attr runList options * Code cleanup * Add date-time-local transform * Add copyright headers * Remove comments * Remove date transform stuff for now! * Put getISODateFormat back into the serailize function * UI: Date time local transform (#24694) * Date time local * Add deserialize * Add copyright header * check if date exists * Use parseISO for date strings since datefns requires this in new update * Update tests * Ensure we cehck for an ISOString * Add checks so tests wont fail * Update parseISO * Address feedback * UI: multiple banner message on create and edit form (#24742) * WIP multiple banner message on create and edit form * Fix tests * Put checks back * Add try/catch to query * Fix breadcrumbs * Add page size to pagination * Add multiple modal message tests * Address feedback * Check for valid form first * Add extra checks * Address feedback * Move getter to the route * Fix tests! * Address more feedback * Use still when cancelling * Update multiple banner modal * Fix tests * Set user confirmation to empty string * UI: VAULT-21539 auth messages display (#24842) * WIP auth message display * Move block to show only when authenticated * VAULT-22046 working search by name * Some code clean up * Fix merge conflict * Add tests * Fetch messages again after creation * UI: [VAULT-22908] Update kv object editor, add max number of messages reached modal, small improvements (#24918) * Update kv object editor to only use a single row * continute using kv editype * Fix failing dashboard tests! * Fix failing test on sidebranch * Fix tests and update validations * Add optional tag * Address feedback * Add documentation * Clear messages when logging out * Fix tests! * Add 100 message limit modal * Add max message modal test * Do more checks! * Pair with Claire on the refactor of validator! * Only show validationerror for multiple rows * Update pageSize to 100 since when paginations are active it causes accessbility errors * Fix tests! * Add links to test * Make banners dismissable * Add cancel button * Address feedback! * Update test selectors * Update validator * Remove validations check in kvobjecteditor * Revert validationError in kvobjecteditor template * Put back if/else statements for link * Add changelog * UI: fix link bug and add colors (#24977) * Fix edit bug and put transform back * Edit badgeColor * Add tests * Revert changes to transform * Edit badge colors * remove universal object transform * Update changelog filename * UI: Add form inline warning (#24986) * Add form inline warning * Remove title * Only show form warning for unauth * Address feedback!
165 lines
5.5 KiB
JavaScript
165 lines
5.5 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
export default function (server) {
|
|
server.get('/sys/config/ui/custom-messages', (schema, request) => {
|
|
if (request.queryParams.authenticated && JSON.parse(request.queryParams.authenticated)) {
|
|
return {
|
|
data: {
|
|
key_info: {
|
|
'01234567-89ab-cdef-0123-456789abcdef': {
|
|
title: 'Has expiration date',
|
|
type: 'modal',
|
|
authenticated: true,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '2023-12-17T02:36:43.986212308Z',
|
|
active: true,
|
|
},
|
|
'22234567-89ab-cdef-0123-456789abcdef': {
|
|
title: 'No expiration date',
|
|
type: 'modal',
|
|
authenticated: true,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '',
|
|
active: true,
|
|
},
|
|
'76543210-89ab-cdef-0123-456789abcdef': {
|
|
title: 'Inactive message',
|
|
type: 'banner',
|
|
authenticated: true,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '2023-11-15T02:36:43.986212308Z',
|
|
active: false,
|
|
},
|
|
'11543210-89ab-cdef-0123-456789abcdef': {
|
|
title: 'Inactive, but start time is past current date',
|
|
type: 'banner',
|
|
authenticated: true,
|
|
start_time: '2024-10-15T02:36:43.986212308Z',
|
|
end_time: '2024-11-15T02:36:43.986212308Z',
|
|
active: false,
|
|
},
|
|
},
|
|
keys: [
|
|
'01234567-89ab-cdef-0123-456789abcdef',
|
|
'22234567-89ab-cdef-0123-456789abcdef',
|
|
'76543210-89ab-cdef-0123-456789abcdef',
|
|
'11543210-89ab-cdef-0123-456789abcdef',
|
|
],
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
data: {
|
|
key_info: {
|
|
'8d6ba39-5c23-50af-3d79-76c26a2845f49': {
|
|
title: 'Unauthenticated custom message title',
|
|
type: 'modal',
|
|
authenticated: false,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '2024-10-15T02:36:43.986212308Z',
|
|
active: true,
|
|
},
|
|
'281e580-da16-89c5-4666-16480e4b7c11d': {
|
|
title: 'Unauthenticated custom message title two',
|
|
type: 'banner',
|
|
authenticated: false,
|
|
start_time: '2021-10-15T02:36:43.986212308Z',
|
|
end_time: '2021-11-15T02:36:43.986212308Z',
|
|
active: false,
|
|
},
|
|
},
|
|
keys: ['8d6ba39-5c23-50af-3d79-76c26a2845f49', '281e580-da16-89c5-4666-16480e4b7c11d'],
|
|
},
|
|
};
|
|
});
|
|
|
|
server.post('/sys/config/ui/custom-messages', () => {
|
|
return {
|
|
id: '01234567-89ab-cdef-0123-456789abcdef',
|
|
data: {
|
|
active: true,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '2024-10-15T02:36:43.986212308Z',
|
|
type: 'modal',
|
|
authenticated: false,
|
|
},
|
|
};
|
|
});
|
|
|
|
server.get('/sys/internal/ui/unauthenticated-messages', () => {
|
|
return {
|
|
request_id: '664fbad0-fcd8-9023-4c5b-81a7962e9f4b',
|
|
lease_id: '',
|
|
renewable: false,
|
|
lease_duration: 0,
|
|
data: {
|
|
key_info: {
|
|
'02180e3f-bd5b-a851-bcc9-6f7983806df0': {
|
|
authenticated: false,
|
|
end_time: null,
|
|
link: {
|
|
title: '',
|
|
},
|
|
message: 'aGVsbG8gd29ybGQgaGVsbG8gd29scmQ=',
|
|
options: null,
|
|
start_time: '2024-01-04T08:00:00Z',
|
|
title: 'Banner title',
|
|
type: 'banner',
|
|
},
|
|
'a7d7d9b1-a1ca-800c-17c5-0783be88e29c': {
|
|
authenticated: false,
|
|
end_time: null,
|
|
link: {
|
|
title: '',
|
|
},
|
|
message: 'aGVyZSBpcyBhIGNvb2wgbWVzc2FnZQ==',
|
|
options: null,
|
|
start_time: '2024-01-01T08:00:00Z',
|
|
title: 'Modal title',
|
|
type: 'modal',
|
|
},
|
|
},
|
|
keys: ['02180e3f-bd5b-a851-bcc9-6f7983806df0', 'a7d7d9b1-a1ca-800c-17c5-0783be88e29c'],
|
|
},
|
|
wrap_info: null,
|
|
warnings: null,
|
|
auth: null,
|
|
mount_type: '',
|
|
};
|
|
});
|
|
|
|
server.get('/sys/internal/ui/authenticated-messages', () => {
|
|
return {
|
|
data: {
|
|
key_info: {
|
|
'6543210-89ab-cdef-0123-456780abcieh': {
|
|
title: 'Authenticated Title One',
|
|
message:
|
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.',
|
|
type: 'modal',
|
|
authenticated: true,
|
|
start_time: '2023-10-15T02:36:43.986212308Z',
|
|
end_time: '2024-10-15T02:36:43.986212308Z',
|
|
options: {},
|
|
},
|
|
'00123858-89ab-cdef-0123-789037ejhdgt': {
|
|
title: 'Authenticated Title One',
|
|
message:
|
|
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nulla augue, placerat quis risus blandit, molestie imperdiet massa. Sed blandit rutrum odio quis varius. Fusce purus orci, maximus ac libero.',
|
|
type: 'banner',
|
|
authenticated: true,
|
|
start_time: '2021-10-15T02:36:43.986212308Z',
|
|
end_time: '2031-10-15T02:36:43.986212308Z',
|
|
options: {},
|
|
},
|
|
},
|
|
keys: ['6543210-89ab-cdef-0123-456780abcieh', '00123858-89ab-cdef-0123-789037ejhdgt'],
|
|
},
|
|
};
|
|
});
|
|
}
|