open-policy-agent / open-policy-agent/java-opa-sdk

Implement crypto.x509 certificate/key parsing builtins

Open
#129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

builtins enhancement evaluator help wanted
Dominant language
Java
Stars
16
Forks
24
Avg merge
8h 17m
Merged PRs (30d)
15

Description

Missing builtins

  • crypto.x509.parse_certificates
  • crypto.x509.parse_and_verify_certificates
  • crypto.x509.parse_and_verify_certificates_with_options
  • crypto.x509.parse_certificate_request
  • crypto.x509.parse_keypair
  • crypto.x509.parse_rsa_private_key
  • crypto.parse_private_keys

Context

These OPA builtins are not implemented in the SDK. Most are exercised by the Rego compliance suite (opa-evaluator/src/test/resources/compliance/.../TestData) and currently raise FunctionNotFoundError; implementing them makes those cases pass.

Belongs in the opa-builtins-crypto module.

Implementation notes

Register each builtin with an @OpaBuiltin-annotated static method (see io.github.open_policy_agent.opa.ast.builtin.impls). Core builtins are listed in BuiltinRegistry.BUILTIN_CLASSES; domain-specific ones live in an opa-builtins-* module exposed via the BuiltinProvider SPI (e.g. RegexBuiltins, CidrBuiltins, SemverBuiltins).

Reference: https://www.openpolicyagent.org/docs/policy-reference/#built-in-functions

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 in the opa-builtins-crypto module and read the OpaBuiltin examples in io.github.open_policy_agent.opa.ast.builtin.impls, along with BuiltinRegistry.BUILTIN_CLASSES and the BuiltinProvider SPI. Use the compliance cases under opa-evaluator/src/test/resources/compliance/.../TestData as the first validation point; done means the listed builtins are registered and those cases no longer raise FunctionNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.