Class ClaimPath

java.lang.Object
org.keycloak.broker.oid4vp.mappers.ClaimPath

public class ClaimPath extends Object
A path locating claims in the claims JSON of a presented credential, configured in dot notation with optional array selectors: address.locality selects a nested claim, nationalities[] selects all array elements, nationalities[0] selects the first element, and a literal dot in a claim name is escaped as \..

Field and all element steps correspond to the object key (string) and all elements (null) kinds of a DCQL claims path pointer as defined by OID4VP 1.0, Section 6.3. The pointer's array index kind is not supported beyond [0]: the verifier removes undisclosed array elements from the presented payload, so positions from the issued credential do not survive selective disclosure, and an index read against the compacted array would silently select a different element than the one the position named at issuance. [0] therefore means the first element of the presentation, which under selective disclosure is the first disclosed element and not necessarily the first issued one.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    One path step.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static ClaimPath
    parse(String path)
    Parses the dot notation path, returning null if it is not well formed.
    List<com.fasterxml.jackson.databind.JsonNode>
    select(com.fasterxml.jackson.databind.JsonNode claims)
    Selects the claims this path points to.
    The parsed steps, for consumers that transform the path rather than resolve it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • steps

      public List<ClaimPath.Step> steps()
      The parsed steps, for consumers that transform the path rather than resolve it.
    • parse

      public static ClaimPath parse(String path)
      Parses the dot notation path, returning null if it is not well formed.
    • select

      public List<com.fasterxml.jackson.databind.JsonNode> select(com.fasterxml.jackson.databind.JsonNode claims)
      Selects the claims this path points to. An all elements step fans out into every array element, so the result may hold several nodes. Null nodes and dead ends select nothing.