vault/ui/mirage/handlers/reduced-disclosure.js
Chelsea Shaw 588dd73fe0
UI: handle reduced disclosure on replication endpoints (#24379)
* add replicationRedacted attribute to cluster model

* disallow access to replication pages if repl endpoints are redacted

* hide replicatio nav item

* Hide replication card on dashboard
2023-12-05 14:31:29 -06:00

23 lines
822 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import modifyPassthroughResponse from '../helpers/modify-passthrough-response';
import { Response } from 'miragejs';
export default function (server) {
server.get('/sys/health', (schema, req) =>
modifyPassthroughResponse(req, { version: '', cluster_name: '' })
);
server.get('/sys/seal-status', (schema, req) =>
modifyPassthroughResponse(req, { version: '', cluster_name: '', build_date: '' })
);
server.get('sys/replication/status', () => new Response(404, {}, { errors: ['disabled path'] }));
server.get('sys/replication/dr/status', () => new Response(404, {}, { errors: ['disabled path'] }));
server.get(
'sys/replication/performance/status',
() => new Response(404, {}, { errors: ['disabled path'] })
);
}