Class RoleTemplateCatalog

java.lang.Object
zeroecho.pki.server.RoleTemplateCatalog

public final class RoleTemplateCatalog extends Object
Strict deterministic loader for versioned built-in role templates.
  • Field Details

    • RESOURCE

      public static final String RESOURCE
      Classpath resource holding the normative role templates.
      See Also:
  • Method Details

    • load

      public static RoleTemplateCatalog load(ClassLoader loader)
      Loads the built-in strict resource through the supplied class loader.
      Parameters:
      loader - class loader owning server resources
      Returns:
      immutable deterministic catalog
    • parse

      public static RoleTemplateCatalog parse(byte[] encoded)
      Parses one complete strict versioned resource.
      Parameters:
      encoded - bounded UTF-8 JSON document
      Returns:
      immutable deterministic catalog
    • templates

      public List<RoleTemplateCatalog.Template> templates()
      Returns the built-in templates.
      Returns:
      immutable templates ordered by stable ID
    • require

      public RoleTemplateCatalog.Template require(String templateId, int version)
      Resolves one exact template.
      Parameters:
      templateId - stable template identifier
      version - exact positive template version
      Returns:
      matching immutable template
    • instantiate

      public List<Permission.Grant> instantiate(RoleTemplateCatalog.Assignment assignment)
      Expands one enabled scoped assignment to explicit immutable grants.
      Parameters:
      assignment - persisted assignment
      Returns:
      deterministic finite grants, or an empty list when disabled