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

feat: Add get-authorization-context policy support in compiler #106

Merged
merged 7 commits into from
Feb 27, 2025

Conversation

Mielek
Copy link
Collaborator

@Mielek Mielek commented Feb 27, 2025

Closes #82

Mielek and others added 5 commits February 27, 2025 15:46
Implement the `get-authorization-context` policy in the authoring interface and handle it in the compiler.

* **Authoring Interface:**
  - Add `GetAuthorizationContext` method to `IInboundContext` interface in `src/Authoring/IInboundContext.cs`.
  - Create `GetAuthorizationContextConfig` class in `src/Authoring/Configs/GetAuthorizationContextConfig.cs` to define the configuration for the policy.
  - Implement `Authorization` class in `src/Authoring/Expressions/Authorization.cs` to represent the authorization object.

* **Compiler:**
  - Add `GetAuthorizationContextCompiler` class in `src/Core/Compiling/Policy/GetAuthorizationContextCompiler.cs` to handle the `get-authorization-context` policy.
  - Update `CSharpPolicyCompiler` in `src/Core/Compiling/CSharpPolicyCompiler.cs` to reference `GetAuthorizationContextCompiler`.
  - Add errors related to `get-authorization-context` policy in `src/Core/Compiling/Diagnostics/CompilationErrors.cs`.

* **Tests:**
  - Add tests for `get-authorization-context` policy in `test/Test.Core/Compiling/GetAuthorizationContextTests.cs` to verify compilation of the policy with required and optional properties, policy expressions, and error handling.
# Conflicts:
#	src/Authoring/IInboundContext.cs
#	test/Test.Testing/Test.Testing.csproj
@Mielek Mielek merged commit 6a5796f into main Feb 27, 2025
3 checks passed
@Mielek Mielek deleted the mielek/mielek-add-get-authorization-context branch February 27, 2025 16:18
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.

Support for get-authorization-context policy in compiler
2 participants