Skip to content

Conversation

@thomas-fossati
Copy link
Contributor

Fix #14

Copy link
Collaborator

@cowbon cowbon left a comment

Choose a reason for hiding this comment

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

LGTM

paths:
/ratsd/chares:
post:
operationId: Ratsd_chares
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is chares other than the mythical ferryman? I’m trying to understand if 401 or 403 is the most appropriate error code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least for now, it seems sufficient to be successfully authenticated to request evidence using this challenge-response API. I cannot imagine a case where users who have provided an authentication token that checks out aren't also allowed to query this interface. In the future, we may add a 403 to handle such cases but for now 401 looks appropriate to me.

version: 0.0.1
tags: []
paths:
/ratsd/chares:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/ratsd/chares:
/ratsd/chalrsp:

Copy link
Contributor Author

@thomas-fossati thomas-fossati Dec 11, 2024

Choose a reason for hiding this comment

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

An alternative is to use Greek in the URI (/ratsd/Χάρης) and the media type (application/vnd.veraison.Χάρης+json):

POST /ratsd/Χάρης HTTP/1.1
Host: host.example
Authorization: Bearer my.jwt.token
Accept: application/eat+jwt; eat_profile="tag:github.com,2024:veraison/ratsd"
Content-Type: application/vnd.veraison.Χάρης+json
Content-Length: 33

{
  "nonce": "MIDBNH28iioisjPy"
}

A fun conversation to have with IETF's Internationalization Directorate :-)

version: 0.0.1
tags: []
paths:
/ratsd/chares:
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest we rename this to a more clear short version as chalrsp
which is more intuitive of what you intend to do.. Personally I struggled with what it means to be a chares?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not challengeReponse in full? ( camelCase or whatever notwithstanding?)

Is this interface only to be used for authentication tokens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this interface only to be used for authentication tokens?

What do you mean by "authentication tokens"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally I struggled with what it means to be a chares?

Chares of Lindos, the sculptor of one of the seven wonders of the world!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this interface only to be used for authentication tokens?

What do you mean by "authentication tokens"?

Just referring to an earlier statement. What is expected in the POST body and what is returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is expected in the POST body and what is returned?

The request body has an application/vnd.veraison.chares+json typed object:

{ "nonce": "base64url_encoded_nonce_" }

The request will also sport the auth token in the Authorization header:

Authorization: Bearer my.jwt.token

The response is a signed EAT with profile tag:github.com,2024:veraison/ratsd

Copy link
Contributor

@yogeshbdeshpande yogeshbdeshpande left a comment

Choose a reason for hiding this comment

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

Some nits

Copy link
Collaborator

@jraman567 jraman567 left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you, @thomas-fossati !

thomas-fossati and others added 4 commits December 18, 2024 11:11
Signed-off-by: Thomas Fossati <[email protected]>
Signed-off-by: Thomas Fossati <[email protected]>
Co-authored-by: Yogesh Deshpande <[email protected]>
Signed-off-by: Thomas Fossati <[email protected]>
Co-authored-by: Jag Raman <[email protected]>
Signed-off-by: Thomas Fossati <[email protected]>
@thomas-fossati thomas-fossati merged commit c0175fe into main Dec 18, 2024
4 checks passed
@thomas-fossati thomas-fossati deleted the api branch December 18, 2024 10:12
@cowbon cowbon mentioned this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define the REST API

7 participants