Add Developer Agreement API - #25418
Conversation
|
I think we'll want
|
bff56f5 to
e284efe
Compare
| .. http:post:: /api/v5/developers/agreement | ||
|
|
||
| :>json string display_name: User's chosen display name. | ||
| :>json string last_developer_agreement_change: The date of the last agreement change. | ||
|
|
||
| .. http:get:: /api/v5/developers/agreement | ||
|
|
||
| Returns the date of the last agreement change. | ||
|
|
There was a problem hiding this comment.
I think this feedback is targeted more towards the ticket itself than this work, but this doesn't match what I had in mind (and again, we should have fleshed this out better - one for a team retro imo).
Feel free to turn this into a proper discussion, I might have misunderstood things.
My expectations (these are just examples, I haven't validated these are real);
http:post::
:>json string user_uuid: something unique to identify the user with
:>json string accepted_agreement_version: version of the developer agreement accepted (or YYYY-MM-DD)
server inferred; UTC date developer agreement accepted
http:get:: (should be public, not internal only per ticket comment from @diox)
:>query/parameter:>json string user_uuid
:>returns: is_latest_accepted: boolean
:>returns: agreement_version: version of the developer agreement (or YYYY-MM-DD)
:>optional return (as in I'm questioning the value of this): agreement_content: markdown content of the latest developer agreement
There was a problem hiding this comment.
should be public, not internal only
Right now it (and the other API work I've done so far) are generally exclusively using SessionIDAuthentication, i.e. 'internal use'. Making it external is mainly adding JWT auth. Is that more in line with what would be needed? In which case I'd need to update those endpoints as well.
See: #25374 (comment)
There was a problem hiding this comment.
@chrstinalin agree on your other comment about user_uuid being extraneous when it's an authenticated request. But from the original, I don't know / understand why you'd want the user display_name?
Regarding internal/external use, I'm basing that requirement on this comment from Mat; mozilla/addons#16377 (comment)
There was a problem hiding this comment.
Regarding internal/external use, I'm basing that requirement on this comment from Mat; mozilla/addons#16377 (comment)
Ahh, right. I forgot to mention. For that, I did see that read_dev_agreement is exposed already through /api/v5/accounts/account/(int:user_id|string:username)/ . So it is possible to get that information via JWT without this endpoint.
aa6180b to
89bd32a
Compare
89bd32a to
2ce6322
Compare

Fixes mozilla/addons#16377
Description
Adds developer agreement API.
Testing
At endpoint
api/v5/developers/agreement--last_developer_agreement_change. Returns 200.display_nameandlast_developer_agreement_changeto accept, if a) agreement was updated since the previous accept, or b) have not yet accepted before. Returns 202.Checklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.