Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'chck operation' endpoint #35

Closed
wants to merge 5 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 84 additions & 5 deletions draft-ietf-scitt-scrapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,25 +270,25 @@ Fresh receipts may be requested through the resource identified in the Location
~~~ http-message
HTTP/1.1 202 Accepted

Location: https://transparency.example/receipts\
/urn:ietf:params:scitt:signed-statement\
Location: https://transparency.example/operations\
/urn:ietf:params:scitt:lro\
:sha-256:base64url:5i6UeRzg1...qnGmr1o

Content-Type: application/json
Retry-After: <seconds>

{

"identifier": "urn:ietf:params:scitt:receipt\
"identifier": "urn:ietf:params:scitt:lro\
:sha-256:base64url:5i6UeRzg1...qnGmr1o",

}

~~~

The response contains a reference to the receipt which will eventually be available for the Signed Statement.
The response contains a reference to the running operation which will eventually be available for the Signed Statement.

If 202 is returned, then clients should wait until Registration succeeded or failed by polling the Resolve Receipt endpoint using the identifier returned in the response.
If 202 is returned, then clients should wait until Registration succeeded or failed by polling the Check Operation endpoint using the identifier returned in the response.

#### Status 400 - Invalid Client Request

Expand Down Expand Up @@ -341,6 +341,85 @@ One of the following errors:

TODO: other error codes

### Check Registration

Authentication MAY be implemented for this endpoint.

This endpoint is used to check on the progress of a long-running registration.

The following is a non-normative example of a HTTP request the status of a running registration:

Request:

~~~http
GET /operations/urn:ietf:params:scitt:lro:sha-256:base64url:5i6UeRzg1...qnGmr1o", HTTP/1.1
Host: transparency.example
Accept: application/json
~~~

Response:

One of the following:

#### Status 201 - Registration is successful

~~~ http-message
HTTP/1.1 201 Ok

Location: https://transparency.example/receipts\
/urn:ietf:params:scitt:signed-statement\
:sha-256:base64url:5i6UeRzg1...qnGmr1o

Content-Type: application/cose

Payload (in CBOR diagnostic notation)

18([ / COSE Sign1 /
h'a1013822', / Protected Header /
{}, / Unprotected Header /
null, / Detached Payload /
h'269cd68f4211dffc...0dcb29c' / Signature /
])
~~~

The response contains the Receipt for the Signed Statement.
Fresh receipts may be requested through the resource identified in the Location header.

The Transparency Service MUST maintain a record of every operation until at least one client has fetched the completed receipt.

The Transparency Service MAY maintain a record of the operation beyond the first successful fetch of the completed receipt.

#### Status 202 - Registration is (still) running

~~~ http-message
HTTP/1.1 202 Accepted

Location: https://transparency.example/operations\
/urn:ietf:params:scitt:lro\
:sha-256:base64url:5i6UeRzg1...qnGmr1o

Retry-After: <seconds>

~~~

The response contains a reference to the running operation which will eventually be available for the Signed Statement.

If 202 is returned, then clients should wait until Registration succeeded or failed by polling the Check Operation endpoint using the identifier returned in the response.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concern for a failed registration returning not found, as the client will not know if it failed due to registration policy, or failed due to a network connection and continues to try.


#### Status 404 - Operation not found

~~~
{
"type": "urn:ietf:params:scitt:error\
:lro:not-found",
"detail": \
"A registration operation with this identifier was not found."
}
~~~

No additional reason codes will be given.
The identifier may have been valid at a point in time but since redeemed and forgotten; or it may have never existed on this Transparency Service.

## Optional Endpoints

The following HTTP endpoints are optional to implement.
Expand Down
Loading