Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates Backward Compatible Context Class #286

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

muditchaudhary
Copy link
Contributor

@muditchaudhary muditchaudhary commented Jan 29, 2025

Description

  1. Currently, CedarJava handles Context as Map<String,Value> without a dedicated class. This PR creates Java equivalent class for Context.
  2. Implements methods to create and merge Contexts within CedarJava. Currently, does not implement from_* methods.
  3. Uses method overloading to make it backward compatible in authorization requests.
  4. Implements tests for Context.
  5. Implements tests to verify backward compatibility in AuthorizationRequest and PartialAuthorizationRequest.

Future Consideration:

  • Create .copy() for all classes that implement Value interface. This will allow us to create deep-copy of any object that use Value. Currently, we can only create shallow copies for objects such as Context. For example, .getContext() creates and returns a shallow copy of the Map<String, Value> context but the Value object can potentially be modified.

Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
…thorizationRequest

Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
@muditchaudhary muditchaudhary marked this pull request as ready for review January 29, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant