mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-17 03:57:01 +02:00
* the fix * working, but work in progress maybe change to another helper, put draft up? * some fixes and restructing * change names * test assert wrong locally, lets see about gh
15 lines
565 B
JavaScript
15 lines
565 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
import timestamp from 'core/utils/timestamp';
|
|
|
|
export function isDeleted(date) {
|
|
// on the kv/data model, deletion_time does not always mean the secret has been deleted.
|
|
// if the delete_version_after is set then the deletion_time will be UTC of that time, even if it's a future time from now.
|
|
// to determine if the secret is deleted we check if deletion_time <= time right now.
|
|
const deletionTime = new Date(date);
|
|
const now = timestamp.now();
|
|
return deletionTime <= now;
|
|
}
|