-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add REST API description #15
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
Conversation
cowbon
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /ratsd/chares: | |
| /ratsd/chalrsp: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.tokenThe response is a signed EAT with profile tag:github.com,2024:veraison/ratsd
yogeshbdeshpande
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits
jraman567
left a comment
There was a problem hiding this 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 !
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]>
Fix #14