public Future<String> getSecret(
            String notation,
            @Nullable GuacamoleExceptionSupplier<Future<String>> fallbackFunction)
            throws GuacamoleException {
        validateCache();
        cacheLock.readLock().lock();
        try {

            // Retrieve any relevant file asynchronously
            Matcher fileNotationMatcher = KEEPER_FILE_NOTATION.matcher(notation);
            if (fileNotationMatcher.matches())
                return recordService.download(Notation.getFile(cachedSecrets, notation));

            // Retrieve string values synchronously
            return CompletableFuture.completedFuture(Notation.getValue(cachedSecrets, notation));

        }

        // Unfortunately, the notation parser within the Keeper SDK
        // only throws plain Errors and Exceptions.
        // There is no way to differentiate if an error is caused by
        // a non-existing record or a pure parse failure.
        catch (Error | Exception e) {
            logger.warn("Keeper notation \"{}\" could not be resolved "
                    + "to a record: {}", notation, e.getMessage());
            logger.debug("Retrieval of record by Keeper notation failed.", e);

            // If the secret is not found, invoke the fallback function
            if (fallbackFunction != null)
                return fallbackFunction.get();

            return CompletableFuture.completedFuture(null);
        }
        finally {
            cacheLock.readLock().unlock();
        }

    }
Returns the value of the secret stored within Keeper Secrets Manager and
represented by the given Keeper notation. Keeper notation locates the
value of a specific field, custom field, or file associated with a
specific record. See: https://docs.keeper.io/secrets-manager/secrets-manager/about/keeper-notation
If a fallbackFunction is provided, it will be invoked to generate
a return value in the case where no secret is found with the given
keeper notation.

@param notation
    The Keeper notation of the secret to retrieve.

@param fallbackFunction
    A function to invoke in order to produce a Future for return,
    if the requested secret is not found. If the provided Function
    is null, it will not be run.

@return
    A Future which completes with the value of the secret represented by
    the given Keeper notation, or null if there is no such secret.

@throws GuacamoleException
    If the requested secret cannot be retrieved or the Keeper notation
    is invalid.
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmClient.java