Skip to main content

Payload Spec

This document lists the request and response payloads for each of the API requests in the Search scenario.

Note: These payloads and corresponding interop results are for the AuthZEN 1.0 Draft 03 version of the spec.

tip

This is a copy of the payload document defined by the AuthZEN WG. The definitive document can be found here.

Changelog

  • Created: May 13 2025

Context

For this interop, we have decided to use a different scenario that is more relevant to fine-grained access control.

Interop Architecture - Subject Search Example

Search App

For the Search Interop, we have decided to build a React Router-based application which acts as a super PEP to an AuthZEN PDP. The React App will be able to create a valid Search API request. It lets users simulate what would happen if a given user logged in and tried to browse data.

Users will be able to choose between:

  • a Subject Search: who can view/edit/delete record 123?
  • a Resource Search: which records can Alice view/edit/delete?
  • an Action Search: which actions can Alice perform on record 123?

The Search Interop Demo App will let users create the request by choosing values from a dropdown (choose the user/record identifier/action). It will also display the AuthZEN payload in JSON format as well as a the Search API response in JSON format and eventually inside a data table.

Scenario

This scenario was originally documented here.

There are 3 actions that the Search API Demo (SAD) application supports:

  • view,
  • edit, and
  • delete

There are two roles defined:

  • employee - this role doesn't give any permission per se.
  • manager - several rules give managers more ability than the base user (or employee).

As previously mentioned, there are six users defined.

Authorization Use Cases

The following are the policies used in the scenario.

  • a user can view any record they own
  • a user can view any record in their department
  • a manager can view any record
  • a user can edit any record they own
  • a manager can edit any record in their department
  • a user can delete any record they own

Note: department and ownership are two separate concepts. A user may own a record that is not in their department. How that occured is beyond this demo.

Information Model

  • user
    • id
    • role
    • department
  • record
    • id
    • title
    • department
    • owner

Sample Data

User Data

There are 6 users in the demo:

IDRoleDepartment
alicemanagerSales
bobemployeeLegal
carolcontractorLegal
danmanagerFinance
erinemployeeFinance
felixcontractorAccounting

Sample data for the demo users is stored in Github (under authzen/interop/authzen-search-demo/data).

See below for the JSON representation.

Record Data

There are 20 records in the demo:

IDTitleDepartmentOwner
101HamletLegalalice
102OthelloLegalbob
103MacbethLegalcarol
104King LearAccountingdan
105Romeo and JulietLegalerin
106A Midsummer Night's DreamAccountingfelix
107The TempestSalesalice
108Twelfth NightLegalbob
109Julius CaesarAccountingcarol
110As You Like ItSalesdan
111Much Ado About NothingAccountingerin
112The Merchant of VeniceLegalfelix
113Henry VSalesalice
114Richard IIIAccountingbob
115CoriolanusFinancecarol
116Taming of the ShrewLegaldan
117Antony and CleopatraLegalerin
118Measure for MeasureAccountingfelix
119The Winter's TaleLegalalice
120All's Well That Ends WellAccountingbob

Sample data for the demo records is stored in Github as well in the same location as user data.

See below for the JSON representation.

Technical Overview

The interop consists of the following components:

  • a simple React Router app frontend that acts as a super PEP. It lets users create AuthZEN Search API requests and send them to a compliant PDP.
  • The React Router app comes with its own backend used to route calls to the PDP.
  • external PDPs provided by the interop participants, which the API gateway calls using the AuthZEN Search API to issue authorization decisions.

The payloads listed below are the contract between the SAD App (the PEP) and the PDP.

Attributes associated with users (expected to come from PIP)

The use case utilizes two user attributes, role and department, that are derived from the user identity. The values are expected to be fetched from a PIP.

[
{
"id": "alice",
"role": "manager",
"department": "Sales"
},
{
"id": "bob",
"role": "employee",
"department": "Legal"
},
{
"id": "carol",
"role": "contractor",
"department": "Legal"
},
{
"id": "dan",
"role": "manager",
"department": "Finance"
},
{
"id": "erin",
"role": "employee",
"department": "Finance"
},
{
"id": "felix",
"role": "contractor",
"department": "Accounting"
}
]

The PIP can, of course, express this in any way they desire. The policy for each implementation has its own contract with its PIP, and this contract is outside of the scope of the PEP-PDP interop scenario.

Attributes associated with resources (expected to come from PIP)

The resource metadata contains 4 attributes of which 2 have bearing on the authorization: the department and the owner attributes. The title attribute is just there for cosmetics.

The PDP may choose to use a PIP to retrieve title and department. The values will not be passed from the demo application.

[
{
"id": 101,
"title": "Hamlet",
"department": "Legal",
"owner": "alice"
},
{
"id": 102,
"title": "Othello",
"department": "Legal",
"owner": "bob"
},
{
"id": 103,
"title": "Macbeth",
"department": "Legal",
"owner": "carol"
},
{
"id": 104,
"title": "King Lear",
"department": "Accounting",
"owner": "dan"
},
{
"id": 105,
"title": "Romeo and Juliet",
"department": "Legal",
"owner": "erin"
},
{
"id": 106,
"title": "A Midsummer Night's Dream",
"department": "Accounting",
"owner": "felix"
},
{
"id": 107,
"title": "The Tempest",
"department": "Sales",
"owner": "alice"
},
{
"id": 108,
"title": "Twelfth Night",
"department": "Legal",
"owner": "bob"
},
{
"id": 109,
"title": "Julius Caesar",
"department": "Accounting",
"owner": "carol"
},
{
"id": 110,
"title": "As You Like It",
"department": "Sales",
"owner": "dan"
},
{
"id": 111,
"title": "Much Ado About Nothing",
"department": "Accounting",
"owner": "erin"
},
{
"id": 112,
"title": "The Merchant of Venice",
"department": "Legal",
"owner": "felix"
},
{
"id": 113,
"title": "Henry V",
"department": "Sales",
"owner": "alice"
},
{
"id": 114,
"title": "Richard III",
"department": "Accounting",
"owner": "bob"
},
{
"id": 115,
"title": "Coriolanus",
"department": "Finance",
"owner": "carol"
},
{
"id": 116,
"title": "Taming of the Shrew",
"department": "Legal",
"owner": "dan"
},
{
"id": 117,
"title": "Antony and Cleopatra",
"department": "Legal",
"owner": "erin"
},
{
"id": 118,
"title": "Measure for Measure",
"department": "Accounting",
"owner": "felix"
},
{
"id": 119,
"title": "The Winter's Tale",
"department": "Legal",
"owner": "alice"
},
{
"id": 120,
"title": "All's Well That Ends Well",
"department": "Accounting",
"owner": "bob"
}
]

Requests and payloads

For each Search API (subject search, resource search, and action search) the following section documents the request/response payload:

  • the AuthZEN requests that the SAD app will issue to AuthZEN-compliant PDPs, and
  • The AuthZEN responses: how the PDPs should respond to each request.

Participating PDPs will, therefore, employ a group of policies that represent the authorization use cases aforementioned.

The following payloads are specified according to the Authorization API 1.0 – draft 03.

They are meant to be sent using the following HTTP(S) request:

Subject Search API

HTTP Request

POST /access/v1/search/subject HTTP/1.1
Host: pdp.mycompany.com
Authorization: Bearer <myoauthtoken>
X-Request-ID: bfe9eb29-ab87-4ca3-be83-a1d5d8305716

JSON Request Payload

{
"subject": {
"type": "user"
},
"action": {
"name": "<action_name>"
},
"resource": {
"type": "record",
"id": "<record_id>"
}
}

The value of <record_id> must be between 101 and 120 to conform with the sample dataset. Any other value should lead to a valid empty response from the PDP.

The value of <action_name> must be either of view, edit, or delete to conform with the demo policies. Any other action should lead to a valid empty response from the PDP.

The presence of the subject type field is required per the specification. All other attributes in the subject object will be ignored.

Response Payload

The following table summarizes the valid responses.

RecordActionUser Identifiers
101view[alice, bob, carol, dan]
101edit[alice]
101delete[alice]
102view[alice, bob, carol, dan]
102edit[bob]
102delete[bob]
103view[alice, bob, carol, dan]
103edit[carol]
103delete[carol]
104view[alice, dan, felix]
104edit[dan]
104delete[dan]
105view[alice, bob, carol, dan, erin]
105edit[erin]
105delete[erin]
106view[alice, dan, felix]
106edit[felix]
106delete[felix]
107view[alice, dan]
107edit[alice]
107delete[alice]
108view[alice, bob, carol, dan]
108edit[bob]
108delete[bob]
109view[alice, carol, dan, felix]
109edit[carol]
109delete[carol]
110view[alice, dan]
110edit[alice, dan]
110delete[dan]
111view[alice, dan, erin, felix]
111edit[erin]
111delete[erin]
112view[alice, bob, carol, dan, felix]
112edit[felix]
112delete[felix]
113view[alice, dan]
113edit[alice]
113delete[alice]
114view[alice, bob, dan, felix]
114edit[bob]
114delete[bob]
115view[alice, carol, dan, erin]
115edit[carol, dan]
115delete[carol]
116view[alice, bob, carol, dan]
116edit[dan]
116delete[dan]
117view[alice, bob, carol, dan, erin]
117edit[erin]
117delete[erin]
118view[alice, dan, felix]
118edit[felix]
118delete[felix]
119view[alice, bob, carol, dan]
119edit[alice]
119delete[alice]
120view[alice, bob, dan, felix]
120edit[bob]
120delete[bob]

The following is the JSON response payload to the question: who can view record 105?

HTTP/1.1 OK
Content-type: application/json
X-Request-ID: bfe9eb29-ab87-4ca3-be83-a1d5d8305716

{
"results": [
{
"type": "user",
"id": "alice"
},
{
"type": "user",
"id": "bob"
},
{
"type": "user",
"id": "carol"
},
{
"type": "user",
"id": "dan"
},
{
"type": "user",
"id": "erin"
}
]
}

The entire request/response payload the resource search is stored in github.

Resource Search API

HTTP Request

POST /access/v1/search/resource HTTP/1.1
Host: pdp.mycompany.com
Authorization: Bearer <myoauthtoken>
X-Request-ID: bfe9eb29-ab87-4ca3-be83-a1d5d8305716

JSON Request Payload

{
"subject": {
"type": "user",
"id": "<user_id>"
},
"action": {
"name": "<action_name>"
},
"resource": {
"type": "record"
}
}

The value of <user_id> must be one of alice, bob, carol, dan, erin, or felix to conform with the sample dataset. Any other value should lead to a valid empty response from the PDP.

The value of <action_name> must be either of view, edit, or delete to conform with the demo policies. Any other action should lead to a valid empty response from the PDP.

The presence of the resource type field is required per the specification. All other attributes in the resource object will be ignored.

Response Payload

The following table summarizes the valid responses.

User IDActionRecords
aliceview[101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120]
aliceedit[101, 107, 110, 113, 119]
alicedelete[101, 107, 113, 119]
bobview[101, 102, 103, 105, 108, 112, 114, 116, 117, 119, 120]
bobedit[102, 108, 114, 120]
bobdelete[102, 108, 114, 120]
carolview[101, 102, 103, 105, 108, 109, 112, 115, 116, 117, 119]
caroledit[103, 109, 115]
caroldelete[103, 109, 115]
danview[101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120]
danedit[104, 110, 115, 116]
dandelete[104, 110, 116]
erinview[105, 111, 115, 117]
erinedit[105, 111, 117]
erindelete[105, 111, 117]
felixview[104, 106, 109, 111, 112, 114, 118, 120]
felixedit[106, 112, 118]
felixdelete[106, 112, 118]

The following is the JSON response payload to the question: which records can Erin view?

HTTP/1.1 OK
Content-type: application/json
X-Request-ID: bfe9eb29-ab87-4ca3-be83-a1d5d8305716

{
"results": [
{
"type": "record",
"id": "105"
},
{
"type": "record",
"id": "111"
},
{
"type": "record",
"id": "115"
},
{
"type": "record",
"id": "117"
}
]
}

The entire request/response payload the resource search is stored in github.

Action Search API

HTTP Request

POST /access/v1/search/action HTTP/1.1
Host: pdp.mycompany.com
Authorization: Bearer <myoauthtoken>
X-Request-ID: bfe9eb29-ab87-4ca3-be83-a1d5d8305716

JSON Request Payload

{
"subject": {
"type": "user",
"id": "<user_id>"
},
"resource": {
"type": "record",
"id": "<record_id>"
}
}

The value of <user_id> must be one of alice, bob, carol, dan, erin, or felix to conform with the sample dataset.

The value of <record_id> must be between 101 and 120 to conform with the sample dataset.

There must not be any action object in the request object.

Response payload

The following table summarizes the valid responses. Note some user ID - record ID combinations are missing. This means that particular combination does not yield any action. The overall payload document caters to that use case.

UserRecord IDAction List
alice101[view, edit, delete]
alice102[view]
alice103[view]
alice104[view]
alice105[view]
alice106[view]
alice107[view, edit, delete]
alice108[view]
alice109[view]
alice110[view, edit]
alice111[view]
alice112[view]
alice113[view, edit, delete]
alice114[view]
alice115[view]
alice116[view]
alice117[view]
alice118[view]
alice119[view, edit, delete]
alice120[view]
bob101[view]
bob102[view, edit, delete]
bob103[view]
bob105[view]
bob108[view, edit, delete]
bob112[view]
bob114[view, edit, delete]
bob116[view]
bob117[view]
bob119[view]
bob120[view, edit, delete]
carol101[view]
carol102[view]
carol103[view, edit, delete]
carol105[view]
carol108[view]
carol109[view, edit, delete]
carol112[view]
carol115[view, edit, delete]
carol116[view]
carol117[view]
carol119[view]
dan101[view]
dan102[view]
dan103[view]
dan104[view, edit, delete]
dan105[view]
dan106[view]
dan107[view]
dan108[view]
dan109[view]
dan110[view, edit, delete]
dan111[view]
dan112[view]
dan113[view]
dan114[view]
dan115[view, edit]
dan116[view, edit, delete]
dan117[view]
dan118[view]
dan119[view]
dan120[view]
erin105[view, edit, delete]
erin111[view, edit, delete]
erin115[view]
erin117[view, edit, delete]
felix104[view]
felix106[view, edit, delete]
felix109[view]
felix111[view]
felix112[view, edit, delete]
felix114[view]
felix118[view, edit, delete]
felix120[view]

The following is the JSON response payload to the question: which actions can Erin do on record 117?

{
"results": [
{
"name": "view"
},
{
"name": "edit"
},
{
"name": "delete"
}
]
}

The following is the JSON response payload to the question: which actions can Erin do on record 118?

{
"results": []
}

The entire request/response payload the resource search is stored in github. Each of the action, resource, and subject subdirectories has a results.json file that captures the expected results.

The test harness runs through the test cases and reports success or failure.