mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-21 22:51:09 +02:00
* VAULT-24469 use sys/seal-status instead of internal version endpoint * Update tests and mirage handlers * Revert "VAULT-20669: Add New Authenticated Endpoint for Version (#23740)" This reverts commit 550c99ae3b6553f12e4a862c915155b8d0a53516. * Readded version_test.go * Reverted any old changes on versionlgo --------- Co-authored-by: divyaac <divyaac@berkeley.edu>
27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
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) => {
|
|
// When reduced disclosure is active, the version is only returned when a valid token is used
|
|
const overrides = req.requestHeaders['X-Vault-Token']
|
|
? { cluster_name: '', build_date: '' }
|
|
: { version: '', cluster_name: '', build_date: '' };
|
|
return modifyPassthroughResponse(req, overrides);
|
|
});
|
|
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'] })
|
|
);
|
|
}
|