aws / aws/aws-secretsmanager-caching-java

Providing access to secret's metadata

Open
#11 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
83
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm working on my fork to slightly modify the source code in order to provide visibility on the secret's metadata.
This information is coming through `DescribeSecret` and it's already cached in the `SecretCacheObject`.

I would like to submit a pull request to your repository and my proposal would be to change the `SecretCacheObject.getResult` method to public and implement a `SecretCache.describeSecret` method like the following:
```
/**
* Method to retrieve the description of a secret from AWS Secrets Manager.
*
* @param secretId
* The identifier for the secret being requested.
* @return The string secret
*/
public DescribeSecretResult describeSecret(final String secretId) {
SecretCacheItem secret = this.getCachedSecret(secretId);
return secret.getResult().clone();
}
```

This way, accessing the secret's metadata does not request a second trip to the AWS SecretsManager or the implementation of a secondary cache.

This is my first pull request here, please be nice ;-)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SecretCacheObject.getResult and SecretCache.getCachedSecret, then inspect how DescribeSecret metadata is cached in SecretCacheItem. The change is complete when callers can retrieve the cached secret metadata through SecretCache.describeSecret without an additional AWS Secrets Manager request; add or update the relevant Java tests to verify that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.