Project: Resource Aliases - ForgeRock/frdp-uma-resource-server GitHub Wiki

Resource Aliases

Why

There may be situations where it would be appropriate to have a "well known" URI to a resource. The current Resource Server implementation exposes a resource with a generic/abstract URI ...

  • http://FQDN/uma-rs/rest/manage/resources/17a899c4-46c9-4ca8-9184-46953d24f503
  • http://FQDN/uma-rs/rest/share/resources/17a899c4-46c9-4ca8-9184-46953d24f503/?scopes=meta+print

The Resource Owner and/or the Requesting Party might want to reference a resource with a friendly / predictable URI pattern ...

  • http://FQDN/uma-rs/rest/manage/path/alice/taxes/2021/q1-filing
  • http://FQDN/uma-rs/rest/share/path/alice/taxes/2021/q1-filing/?scopes=meta+print

How

Implement a dynamic alternate "end point" that would be managed by the Resource Owner. This would essentially be an "alias" for a resource.

Resource alias maps would be maintained in a persistent data store.

Requirements

  • Any valid relative URI could be used for the alias.
  • The alias must be unique within a given Resource Server.
  • The resource must exist before the alias can be created.
  • If the resource is deleted, the alias will be deleted.

What

Proposed Alias Configurations

The table below describes possible combinations of mapping an "alias" to a "resource":

Type Description
One-2-One One relative URI path (alias) maps to a single UUID (resource)
One-2-Many One relative URI path (alias) maps to multiple UUIDs (resources)
Many-2-One Multiple relative URI paths (aliases) map to a single UUID (resource)
Many-2-Many Multiple relative URI paths (aliases) map to multiple UUIDs (resources)

One-2-One

A single valid URI (alias) is associated to a single UUID (resource).

Alias Resource Description
Syntax RELATIVE_URI_PATH RESOURCE_UUID
Example Alice/taxes/2021/q1-filing 17a899c4-46c9-4ca8-9184-46953d24f503 2021 Quarter 1 filling tax document for Alice

One-2-Many

A single valid URI (alias) is associated to multiple UUIDs (resources). Operations against a give alias will apply to all associated UUIDs.

Alias Resources Description
Syntax RELATIVE_URI_PATH RESOURCE_UUID_1,RESOURCE_UUID_x
Example Alice/taxes/2021 17a899c4-46c9-4ca8-9184-46953d24f503, 239bb78a-3490-aa4b-725c-72601ef210ae All tax documents for Alice's tax year 2021

Many-2-One

Multiple URIs (aliases) can be associated to a single UUID (resource).

Aliases Resource Description
Syntax RELATIVE_URI_PATH_1, RELATIVE_URI_PATH_x RESOURCE_UUID
Example products/widget/docs/userguide/1.2.3, products/widget/docs/userguide/latest 239bb78a-3490-aa4b-725c-72601ef210ae Be able to reference a specific UUID (resource) with a URI (alias) that uses an absolute version or a URI (alias) that specifies the "latest" version.

Many-2-Many

Multiple URIs (aliases) can be associated to a multiple UUIDs (resources).

Aliases Resources Description
Syntax RELATIVE_URI_PATH_1, RELATIVE_URI_PATH_x RESOURCE_UUID_1, RESOURCE_UUID_x
Example Alice/medical/records/current_year, Alice/medical/records/2021 239bb78a-3490-aa4b-725c-72601ef210ae, 17a899c4-46c9-4ca8-9184-46953d24f503 Be able to reference a collection of UUIDs (resources) with a URI (alias) that reference a specific year or a URI (alias) that references the "current" year.

Design

Extend the resource JSON structure:

{
    "meta": { },
    "content": { },
    "register": { },
    "aliases" : [ "Alice/medical/records/current_year", "Alice/medical/records/2021" ]
}