Skip to content

Instantly share code, notes, and snippets.

@andorsk
Last active December 19, 2024 09:38
Show Gist options
  • Select an option

  • Save andorsk/a7fcfa75d178f51cbe6dd9cc9224b772 to your computer and use it in GitHub Desktop.

Select an option

Save andorsk/a7fcfa75d178f51cbe6dd9cc9224b772 to your computer and use it in GitHub Desktop.
TRQP Updates and User Guide

TRQP User Guide

The following is a companion guide to help developers/implementers implement the Trust Registry Query Protocol (TRQP). This is a non-normative document.

The TRQP Is a Bridge

The TRQP is NOT meant to replace an exiting intra-trust framework, such as Open ID Federation, X509 Chains, EBSI Trust Chains, TRAIN, or other types of frameworks. The TRQP is meant to be a bridge across frameworks. Therefore, it must speak the lowest common denominator across trust frameworks. The TRQP, is what we call a inter-trust framework. It is intended to establish trust across ecosystems and trust frameworks.

It does so by answering the fundamental question: "Does Entity X have Authorization Y, in the context of Ecosystem Governance Framework Z?".. Put another way, the TRQP is answering the a quesition about whether a particular subject, has an authorization, under a specific ecosystem governance framework (EGF). For example, a question that the TRQP may facilitate is, during a presentation exchange: "Is issuer X authorized to issue credential Y under this ecosystem Z".

We call this the triples model, and you see some examples here.

When we bridge across ecosystems, we develop adapters specific to the ecosystem. For example, in the diagram below:

diagram

The TRQP bridges many different types of systems, because it abstracts the intra-trust framework into a more general intra-trust framework. This is very important. As an implementer, you MUST develop your own opinions about how to develop trust intra-ecosystem. A list of resources to understand to help you design your trust system can be found here.

4 Things to Take Away

  • The TRQP does NOT replace your intra-ecosystem trust framework. It is a complement.
  • The TRQP is a bridge across various trust frameworks and agnostic to a particular intra-trust method.
  • The TRQP does NOT specify how you develop your inter-trust bridge. That is for you to figure out ( but this guide can give some suggestions ).
  • The TRQP is meant to answer one question: "Does Entity X have Authorization Y, in the context of Ecosystem Governance Framework Z?".

Core Requirements Of Implementing The TRQP. A Trust Registry capable of Serving the Authorization State of the Ecosystem.

Within your ecosystem, one of the fundamental requirements is a way for an trust regisry to have the capability to discover the state of the authorization space within it's scope. The trust registry serves as an authoritative source for the ecosystem.

This means that while your methods may be decentralized, the ecosystem trust registry MUST have knowledge about the authorization, the entity, and how to share the state of the entities authorization within it's own governance framework.

A critical distinction to make is that a trust registry is NOT an ecosystem. A trust registry is a capability of an ecosystem.

The TRQP is supported by profiles. Profiles describe the transports and data models used to achieve technical interoperability. For example, a profile may describe identifiers as a URI, metamodels with certain data models, specific encodings, and describe the transports required for technical interopability. Another profile may describe a DIDComm based transport with DID based identifiers and an entirely different metamodel.

The expectation is that as time moves on, the ecosystems will converge on specific profiles that promote interopability, in the same way that we mostly charge with USB-C now because of the convergence on connector profiles. The TRQP specification supports the general requirements of the profile, but does not establish the same opinionations a profile will have.

Three Things To Take Away

  • A trust registry MUST have a way to represent the state of authorizations within the ecosystem. It is up to the ecosystem to figure out how to bubble the information up to the Trust Registry. The Trust Registry serves as an authoritative source for an ecosystem.
  • The Trust Registry Query Protocol defines the base requirements for a technical interoperability profile. The technical interoperability profile defines the specifics such as transports, data models, and identifiers.

Standard Interaction Patterns

Simple Structure ( Case A )

Simple structure is a single trust registry with a shallow network. In this case, the Trust Registry provides an authorization to issuer to a basic credential, which the verifier looks up the authorization over the Trust Registry API endpoints via TRQP.

graph TD
  TrustRegistry -->|authorizes basic credential issuance| Issuer 
  Issuer -->|issues credential A| Holder 
  Holder <-->|requests credential A| Verifier 
  Verifier -.->|trusts| TrustRegistry 
  Verifier -.->|query issuer status| TrustRegistry 

Loading

In the single hop case, the verifier simply queries the trust registry and gets a response back.

sequenceDiagram 
  actor verifier
  participant TrustRegistry
  
  verifier -->> TrustRegistry : request
  TrustRegistry -->> verifier : response

Loading

Brigde Example : Open ID Federation

Let's take an example of OIDF. If you would like to implement a OIDF Bridge into the TRQP, the OIDF ecosystem MUST have awarnness of the authorization states of the OIDF ecosystem. How that is to be done is up to the OIDF ecosystem, but here's an example of how it may be done. This is non-normative and meant purely to demonstrate an example.

Let's take the example from the Open ID Federation Specification:

-----------------.            .-----------------.
|  Trust Anchor A |            |  Trust Anchor B |
'------.--.-------'            '----.--.--.------'
       |  |                         |  |  |
    .--'  '---. .-------------------'  |  |
    |         | |                      |  |
.---v.  .-----v-v------.   .-----------'  |
| OP |  | Intermediate |   |              |
'----'  '--.--.--.-----'   |    .---------v----.
           |  |  |         |    | Intermediate |
   .-------'  |  '------.  |    '---.--.--.----'
   |          |         |  |        |  |  |
.--v-.      .-v--.     .v--v.   .---'  |  '----.
| RP |      | RS |     | OP |   |      |       |
'----'      '----'     '----'   |   .--v-.   .-v--.
                                |   | RP |   | RP |
                                |   '----'   '----'
                                |
                        .-------v------.
                        | Intermediate |
                        '----.--.--.---'
                             |  |  |
                       .-----'  |  '----.
                       |        |       |
                    .--v-.   .--v-.   .-v--.
                    | OP |   | RP |   | AS |
                    '----'   '----'   '----'

On issuance, a holder in the OIDF ecosystem may have a signed JWT claim set anchored to the Trust Anchor. For example, the entity claim set may look like this:

{
  "authority_hints": [
    "https://umu.se"
  ],
  "exp": 1568397247,
  "iat": 1568310847,
  "iss": "https://op.umu.se",
  "sub": "https://op.umu.se",
  "jwks": {
    "keys": [
      {
        "e": "AQAB",
        "kid": "dEEtRjlzY3djcENuT01wOGxrZlkxb3RIQVJlMTY0...",
        "kty": "RSA",
        "n": "x97YKqc9Cs-DNtFrQ7_vhXoH9bwkDWW6En2jJ044yH..."
      }
    ]
  },
  "metadata": {
    "openid_provider": {
      "issuer": "https://op.umu.se/openid",
      "signed_jwks_uri": "https://op.umu.se/openid/jwks.jose",
      "authorization_endpoint":
        "https://op.umu.se/openid/authorization",
      "client_registration_types_supported": [
        "automatic",
        "explicit"
      ],
      "request_parameter_supported": true,
      "grant_types_supported": [
        "authorization_code",
        "implicit",
        "urn:ietf:params:oauth:grant-type:jwt-bearer"
      ],
      "id_token_signing_alg_values_supported": [
        "ES256", "RS256"
      ],
      "logo_uri":
        "https://www.umu.se/img/umu-logo-left-neg-SE.svg",
      "op_policy_uri":
        "https://www.umu.se/en/website/legal-information/",
      "response_types_supported": [
        "code",
        "code id_token",
        "token"
      ],
      "subject_types_supported": [
        "pairwise",
        "public"
      ],
      "token_endpoint": "https://op.umu.se/openid/token",
      "federation_registration_endpoint":
        "https://op.umu.se/openid/fedreg",
      "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "client_secret_basic",
        "client_secret_jwt",
        "private_key_jwt"
      ]
    }
  }
}

As per the OIDF specification, the Relying Party would following the chain of metadata, getting the entity configurations and subordinate statements all the way to the trust anchor.

This works great intra-trust, but externally one would need to know how to resolve the entire OIDF trust chain to make this work.

Therefore, the alternative is that instead of resolving the entire trust chain, the ecosystem can impose a rule for entities to register with the Trust Registry as an authorized entity. The Trust Registry now will have a state of the ecosystem, to which it can answer the question about authorization. For example, is the Intermediate party authorized to issue claims about X under this governance framework.

Ecosystem Governance Framework. What Does It Mean Practically?

An ecosystem governance framework is a governance framework for a digital trust ecosystem. An ecosystem governance framework may incorporate, aggregate, or reference other types of governance frameworks such as a credential governance framework or a utility governance framework.

For many ecosystems, this is a website that can be resolved by the TRQP. The mechanism for resolution depends on the TRQP Profile. The TRQP Profile is defines the resolution and data models required for practical interoperability. A major effort of work happening in the Trust Registry Task Force (TRTF) at Trust Over IP (ToIP) right now is improving the data models and transport definitions. For now, the easiest thing to implement is the OpenAPI Specification.

Which means that an EGF is as URI that points to the ecosystem governance documents. This means an HTTP resolvable endpoint with currently no requirements returned data types. The important part is that this data will be used to make trust decisions and that actors that want to use the ecosystem MUST understand how to use the ecosystem.

What's an Authorization and How Do I Implement It?

An authorization represents a set of privileges granted to an entity; conveys an “official” sanction to perform a cryptographic function or other sensitive activity. (Source: NIST NIST SP 800-57 Part 2 Rev.1 under Authorization).

An authorization is identified by a string and on resolution MAY represent a complex data type that is expressed differently base on the TRQP Profile requirements. The specification below describes the base authorization identifier, and if more information is needed, the Authorization Metadata Model that describes the authorization in more detail, left to the TRQP profile to describe and resolve when queried.

Base Specification

  • Identifier : An authorization is bound to an EGF and MUST be a unique string within context of the controlling EGF. Authorization identifiers do not have any semantic implications unless determined by the profile specification. For example, the authorization string issue/drivers_license is technically equivilent to 79AA39AA-7BB8-45D5-9519-A90D615B7305. An authorization ID means a unique set of capabilities and thus MUST be uniquely comparable within an EGF. Profiles MAY bind specific requirements of the Authorization ID, such as global uniqueness, per their requirement. A TRQP profile MAY describe the method of resolution to the identifier.
  • Authorization Resolution : Resolution of the authorizations are determined by the TRQP profiling mechanism. A profile MAY describe the mechanics for resolving an authorization to allow for interoperability requirements. For example, if the authorization is a HTTP URI, http://example.com/issue/drivers_license represents an HTTP resolvable URI that expresses the Authorization data model. A profile MUST describe the encoding, resolution, and properties to resolve the Authorization information request.
  • Profile: If resolvable, a TRQP profile MUST describe the encoding mechanism of the Authorization Data Model (for example, JSON, CBOR, etc) when queried.
  • On resolution, the Authorization Metadata Model that is resolved on lookup must have the following properties which are described along with the encoding in the Profile:
    • Identifier: MUST have a unique identifier of the authorization. The identifier rules are bound to the profile.
    • Description: MAY provide a description of the authorization in a human readable format.
    • Name: It MAY provide a human readable name of the idenifier for referencing the authorization.
    • Controller: It MAY provide a manager of the authorization at which it is managed under. This may be a EGF.
  • Authorization Controller: An authorization controller is the entit(ies) that manage and control the capability that is being attested against by the Trust Registry. The authorization SHOULD be managed under the same ecosystem governance framework as the EGF the authorization is bound to. There are cases where the controller of the authorization MAY be delegated to a third party.

Types of Supported Registry Entries

The TRQP supports two types of registry entries: Entities and Registries

  1. Entries about atomic entities. For example, an issuer. When a Trust Registry makes a statement about an entity, it is making a claim about the authorization statue of the entity.
  2. Other registries. A registry may acknowledge and recognize another registry under a particular authorization. This means that it recognizes the ability for the registry to answer questions about authorizations under the scope of permission. For example, in the US, the Department of Homeland Security acknolwedges the rights of the the Department of Motor Vehicles to issue drivers licenses. The Department of Motor Vehicles has it's own trust registry. It may recognize other registries under it's jurisdiction all the way down until the final issuer. By starting with the Department of Homeland Security and working your way down, you may eventually acknowledge the Registry that has information about the subject that your interested in. There are various types of registry relationships with a registry. We have 4 types so far: peer, subordinate, meta, and superior. In the case of the DHS and the DMV, the DHS recognizes the DMV as a subordinate registry.

Trust Registry Metadata And Other Trust Registry Considerations

A Trust Registry may serve one or many ecosystems. A trust registry will express itself via the metadata property of a profile. All profiles MUST have a way to express the metadata property.

A critical part of the metadata expression is the concept of a Trust Registry controller. The Trust Registry controller is the entity that is in control of the registry. This is a critical consideration for a trust decision.

How the controller is expressed is decided in the TRQP profile, but as an example: a controller may be a DID. Within the DIDDocument, there is a controller field. This is one potential way to express control of a DID Document.

Offline Support

Currently, the TRQP does not enforce offline support as the base specificatino. A profile MAY enforce offline support if needed, and will have to also specify the methodology to achieve offline support.

Security Considerations

General Trust Anchor problems:

https://packetvis.com/blog/rpki-trust-anchor-malfunctions/

  • Trust Anchor Hijacking
    • Trust Registry Bugs: Could report the wrong authorization type. Similarly, a hacker may try to subvert the system to report the wrong authorization types.
  • Trust Anchor Spoofing:
  • No reporting mechanism for compromised attacks
  • Replay Attacks: Unauthorized actors could reuse valid but previously captured requests or responses to gain unauthorized access or disrupt operations.
  • Data Integrity: Implement cryptographic measures to ensure that data returned from the registry has not been tampered with during transit or within the system.
  • Denial of Service (DoS) Attacks: Attackers may attempt to overload the registry with an excessive number of queries, leading to service degradation or downtime.
  • Insufficient Data Validation Failure to validate input data (e.g., schema IDs, queries, or authorization tokens) could result in injection attacks or misbehavior of the registry.
  • Trust Anchor Compromise: If the root or intermediary trust anchors of the registry are compromised, attackers could create false entries or invalid responses, undermining the registry’s reliability.
  • Logging and Auditing: Ensure detailed and secure logging of all access and modification events in the registry to detect and respond to malicious activities.
  • Protocol Downgrade Attacks: Attackers might force a client or registry to use an older, less secure version of the protocol. All implementations should default to the latest, most secure version.
  • Privacy Concerns: Consider whether queries to the registry or responses might inadvertently leak sensitive information to unauthorized parties. Use encryption to protect sensitive data during transmission.
  • Timing Attacks: Be aware of information disclosure through timing discrepancies when processing queries or authorizations. Constant-time algorithms can help mitigate such risks.

RESTful/DID Based TRQP Profile

Introduction

This is a RESTful, DID based TRQP profile. It requires a small update to the DID Document of an EGF to support an egfURI.

Identifiers

This profile leverages DID identifiers for control objects ( such as EGF's and Entity Identifiers ) and URI's for all non-control objects ( such as authorizations ).

All DID's are supported as long as are able to handle service endpoints and a egfURI field in the DIDDocument upon resolution.

Trust Registry

Identifiers

  • The Trust Registry MUST be identifiable using a Decentralized Identifier (DID), with the controlling entities specified in the controller field.
  • The Service Endpoint MUST reference the Trust Registry using the type TRQPv1HTTPProfile.
  • The Trust Registry MUST provide the controlling DID URL at the /metadata endpoint.

Metadata

  • Encoding:

    • The Trust Registry Metadata Data Model MUST be expressed in JSON format as per RFC 8259.
      • id: Represents the DID of the Trust Registry.
      • description: Provides a description of the Trust Registry. All descriptions MUST be fewer than 4096 bytes to ensure network compliance.
      • name: Denotes the human-readable name of the Trust Registry.
      • controllers: An array of DID URLs representing the controller DIDs of the Trust Registry. This field MUST be present.
  • The metadata MUST be signed using a JSON Web Signature (JWS) as specified in RFC 7515.

JSON Schema

Below is the JSON Schema defining the structure of the Trust Registry metadata:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Trust Registry Metadata",
  "type": "object",
  "properties": {
    "id": {
      "description": "Decentralized Identifier (DID) of the Trust Registry.",
      "type": "string",
      "pattern": "^did:[a-z0-9]+:[a-zA-Z0-9]+$"
    },
    "description": {
      "description": "Description of the Trust Registry.",
      "type": "string",
      "maxLength": 4096
    },
    "name": {
      "description": "Human-readable name of the Trust Registry.",
      "type": "string"
    },
    "controllers": {
      "description": "Array of DID URLs representing the controllers of the Trust Registry.",
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "minItems": 1
    }
  },
  "required": ["id", "description", "name", "controllers"],
  "additionalProperties": false
}

Notes

  • DID Pattern: The id field uses a regex pattern to ensure it follows the standard DID format (did:method:identifier). Adjust the pattern as necessary to accommodate specific DID methods.
  • Controllers: The controllers array requires at least one DID URL. Each entry must be a valid URI as per JSON Schema's format: uri.
  • Security: Ensure that the JSON data adhering to this schema is properly signed using JWS to maintain integrity and authenticity.
    Endpoints Trust Registry MUST support a GET /metadata endpoint. It MUST return the JWS Trust Registry Metadata Model described above. Verifiers SHOULD verify the signature before proceding to trust the Trust Registry.

Ecosystem Governance Framework

All ecosystem governance frameworks are HTTP resolvable URIs managed by a DID Controller.

All DID's with a service endpoint are allowed, but an additional egfURI MUST be registered in the DID Document to point to the ecosystem governance framework. The egfURI MUST be a HTTP resolvable URI with information about the governance framework. There is no machine level governance model to resolve the ecosystem governance framework as a whole.

The following example demonstrates how a DID Document did:web:ebfexample may be resolved to an egf.

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/suites/jws-2020/v1"
  ],
  "id": "did:web:example.com",
  "egfURI": "http://example.com/governance",
  "verificationMethod": [
    {
      "id": "did:web:example.com#key-0",
      "type": "JsonWebKey2020",
      "controller": "did:web:example.com",
      "publicKeyJwk": {
        "kty": "OKP",
        "crv": "Ed25519",
        "x": "0-e2i2_Ua1S5HbTYnVB0lj2Z2ytXu2-tYmDFf8f5NjU"
      }
    },
    {
      "id": "did:web:example.com#key-1",
      "type": "JsonWebKey2020",
      "controller": "did:web:example.com",
      "publicKeyJwk": {
        "kty": "OKP",
        "crv": "X25519",
        "x": "9GXjPGGvmRq9F6Ng5dQQ_s31mfhxrcNZxRGONrmH30k"
      }
    },
    {
      "id": "did:web:example.com#key-2",
      "type": "JsonWebKey2020",
      "controller": "did:web:example.com",
      "publicKeyJwk": {
        "kty": "EC",
        "crv": "P-256",
        "x": "38M1FDts7Oea7urmseiugGW7tWc3mLpJh6rKe7xINZ8",
        "y": "nDQW6XZ7b_u2Sy9slofYLlG03sOEoug3I0aAPQ0exs4"
      }
    },
  ],
  "authentication": [
    "did:web:example.com#key-0",
    "did:web:example.com#key-2"
  ],
  "assertionMethod": [
    "did:web:example.com#key-0",
    "did:web:example.com#key-2"
  ],
  "keyAgreement": [
    "did:web:example.com#key-1", 
    "did:web:example.com#key-2"
  ]
}
graph TD
  DID -->|resolve| DIDDoc -->|extract EGFURI| EGFURI -->|points| EGFDocumentation
Loading

Authorization

  • Identifier: HTTP resolvable URI string following HTTP(s) URI pattern RFC 3986. i.e
  • Encoding:
    • Authorization Data Model will be expressed in JSON encoding per RFC 8259.
      • id will represent the identifier property. It MUST be a HTTP resolvable URI.
      • description: represents the Description property. All descriptions MUST be < 4096 bytes to be compliant with the network.
      • name: represents the human readable name of the authorization.
      • controller : represents the EGF DID of the controlling entity of the Authorization. See the EGFDID rules for how to describe and resolve the EGF profile. Here is a JSON schema to describe the encoding:
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Authorization",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://.+",
      "description": "A HTTP resolvable URI serving as the unique identifier."
    },
    "description": {
      "type": "string",
      "maxLength": 4096,
      "description": "A description of the authorization. Must be less than 4096 bytes."
    },
    "name": {
      "type": "string",
      "description": "The human-readable name of the authorization."
    },
    "controller": {
      "type": "string",
      "format": "uri",
      "pattern": "^http://.+",
      "description": "The EGF URI of the controlling entity of the Authorization."
    }
  },
  "required": ["id", "description", "name", "controller"],
  "additionalProperties": false
}
  • HTTP Interface Lookups
    • GET /authorizations/{egfDID}/{id} : returns a single JSON encoded Authorization Data Model. If id is not provided, returns a list of all authorizations.
      • {id} represents the authorization identifier
      • {egfDID} represents the DID of the Ecosystem Governance Framework in Context.

In the HTTP Lookup, it follows HTTP response standard status codes. A few particular and more common HTTP response codes are described in more detail below.

  • 200 Status OK : In the case where the egfDID authorization is resolvable.
  • 404 Not Found : To be returned when either the authorization identifier or the egfDID is not found within the Trust Registry.
  • 401 Unauthorized : Status code only works intra-ecosystem.

By default, all responses cross ecosystems should be considered public because there is no shared authorization mechanism within this profile. Therefore, any cross ecosystem request will not have an authorization contenxt to evaluate.

  • Security Considerations
    • This profiles does NOT enforce signing of the responses by the controlling EGF. This is to allow for easier adoption patterns, but a higher assurance profile MAY include a signing requirement against the JSON document to ensure that the authorization data has not been tampered with according to the EGF.
    • This is HTTP based profile. Therefore, in identifiers not backed by HTTPS, TLS (SSL) advantages of HTTPS are not provided.

Entity Status Request

The Entity Status Request allows clients to verify the authorization status of an entity within the Trust Registry. All responses to these requests MUST be signed by the controller of the Trust Registry using a JSON Web Signature (JWS) to ensure authenticity and integrity.

Below, all times are represented as ISO8601.

Authorization Response

The response to an Entity Status Request is a JSON object containing the authorization status of the entity. Below is the structure of the Authorization Response:

{
  "recognized": true,
  "authorized": true,
  "message": "",
  "evaluated_at": "2024-04-27T14:30:00Z",
  "response_time": "2024-04-27T14:30:05Z",
  "expiry_time": "2024-05-27T14:30:00Z"
}

Response Fields

  • recognized (boolean): Indicates whether the entity ID is recognized by the Trust Registry.
  • authorized (boolean): Specifies whether the entity is authorized under the provided authorization ID.
  • message (string): Provides additional information or context regarding the authorization status.
  • evaluated_at (string, date-time): The timestamp when the authorization status was evaluated.
  • response_time (string, date-time): The timestamp when the response was generated.
  • expiry_time (string, date-time): The timestamp when the authorization status expires.

HTTP Endpoints

The Trust Registry MUST expose the following HTTP endpoint for Entity Status Requests:

GET /authorized/{entity_id}/{authorization_id}/{egf_id}/{time}

Endpoint Parameters

  • entity_id (string): The unique identifier of the entity whose authorization status is being queried.
  • authorization_id (string): The specific authorization identifier under which the entity is being evaluated.
  • egf_id (string): The identifier for the governance framework or policy context.
  • time (string, date-time): The timestamp at which the authorization status is requested.

HTTP Response Codes

  • 200 OK: The entity is authorized under the specified authorization_id.

    Response Body Example:

{
  "recognized": true,
  "authorized": true,
  "message": "Entity is authorized under the specified authorization ID.",
  "evaluated_at": "2024-04-27T14:30:00Z",
  "response_time": "2024-04-27T14:30:05Z",
  "expiry_time": "2024-05-27T14:30:00Z"
}
  • 404 Not Found: The entity is not found in the Trust Registry.

    Response Body Example:

{
  "recognized": false,
  "authorized": false,
  "message": "Entity not found.",
  "evaluated_at": "2024-04-27T14:35:00Z",
  "response_time": "2024-04-27T14:35:05Z",
  "expiry_time": null
}
  • 401 Unauthorized: The request is forbidden or lacks valid authentication credentials.

    Response Body Example:

{
  "recognized": false,
  "authorized": false,
  "message": "Forbidden request. Invalid or missing credentials.",
  "evaluated_at": "2024-04-27T14:40:00Z",
  "response_time": "2024-04-27T14:40:05Z",
  "expiry_time": null
}

JSON Schema

Below is the JSON Schema defining the structure of the Authorization Response:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Authorization Response",
  "type": "object",
  "properties": {
    "recognized": {
      "description": "Indicates whether the entity ID is recognized by the Trust Registry.",
      "type": "boolean"
    },
    "authorized": {
      "description": "Specifies whether the entity is authorized under the provided authorization ID.",
      "type": "boolean"
    },
    "message": {
      "description": "Additional information regarding the authorization status.",
      "type": "string"
    },
    "evaluated_at": {
      "description": "Timestamp when the authorization status was evaluated.",
      "type": "string",
      "format": "date-time"
    },
    "response_time": {
      "description": "Timestamp when the response was generated.",
      "type": "string",
      "format": "date-time"
    },
    "expiry_time": {
      "description": "Timestamp when the authorization status expires.",
      "type": ["string", "null"],
      "format": "date-time"
    }
  },
  "required": ["recognized", "authorized", "message", "evaluated_at", "response_time"],
  "additionalProperties": false
}

Notes

  • DID Pattern: The id field uses a regex pattern to ensure it follows the standard DID format (did:method:identifier). Adjust the pattern as necessary to accommodate specific DID methods.

  • Controllers: The controllers array requires at least one DID URL. Each entry must be a valid URI as per JSON Schema's format: uri.

  • Security:

    • All JSON objects, including metadata and authorization responses, MUST be signed using JSON Web Signatures (JWS) to ensure data integrity and authenticity.
    • Ensure that the Trust Registry's private keys are securely managed to prevent unauthorized signing of responses.
  • HTTP Endpoints:

    • The /authorized/{entity_id}/{authorization_id}/{egf_id}/{time} endpoint MUST validate all path parameters to prevent injection attacks and ensure proper formatting.
    • Implement appropriate rate limiting and authentication mechanisms to protect the endpoint from abuse.
  • Timestamp Formats:

    • All timestamp fields (evaluated_at, response_time, expiry_time) MUST adhere to the RFC 3339 date-time format to ensure consistency and interoperability.
  • Error Handling:

    • Provide clear and descriptive messages in the message field to aid in debugging and user understanding.
    • Avoid exposing sensitive information in error messages to maintain security best practices.

Other Considerations

This profile does not dicatate how one receives the Authorization ID, Ecosystem Governance Framework, and Subject to inquire about. That is left to the Ecosystem to determine.

TRQP Update

The Trust Registry Query Protocol (TRQP) is an inter-trust framework query protocol. It is meant specifically for QUERY based operations within a particular trust network. It achieves this by providing a limited but common set of capabilities across trust frameworks to form a inter-trust framework bridge capability. It is a complement to existing trust frameworks such as Open ID Federation, EU Trust Lists, EBSI Trust Chains, X509 Certs, and many others. It is NOT intended to replace them.

While it is important that bridges/adapters exist to make the TRQP useful, it is not the scope of this specification to define how to make an adapter. That is left to each ecosystem to determine.

https://trustoverip.github.io/tswg-trust-registry-protocol/images/puml/protocol-bridging.png

The TRQP is currently in implementers review since April 2024. This means we’ve had many months to learn about where the specification needs to be improved in order for it to be consumed by a larger audience.

An effort is happening today to leverage the community feedback to improve the specification.

If you would like to use the TRQP, we welcome your feedback. The TRQP is implementable, but there will be likely questions you will have as you try to implement it, as the language needs to be clarified in a few key places. We are working on improving the specification, but until then please reach out to the Trust Over IP (ToIP) community to learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment