<div dir="ltr"><div>We had a use case call which produced these use cases [0]. Then @fdobrovo investigated using the django-rest-framework-jwt [1] to fulfil those use cases and there are some small, but to fulfil the use cases written he had to write a good amount of code and maybe only used 50 or 100 lines of code actually from django-rest-framework-jwt.<br><br>Through a lot of back and forth on the issue [2], we did a gap analysis and considered different ways the use cases could be aligned with the functionality provided by the django-rest-framework. We came up with the following revised use cases related to JWT that are effectively the same and would allow the plugin code to be used mostly as-is:<br><br><div id="gmail-magicdomid300" class="gmail-ace-line"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">* As an administrator, I can disable JWT token expiration.  This configuration is in the settings file and is system-wide.</span></div><div id="gmail-magicdomid273" class="gmail-ace-line"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">*
 As an administrator, I can configure the JWT tokens to expire after a 
configurable amount of time. This configuration is in the settings file 
and is system-wide.</span></div><div id="gmail-magicdomid8" class="gmail-"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">* The JWT shall have a username identifier</span></div><div id="gmail-magicdomid227" class="gmail-ace-line"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">* As an API user, I can authenticate any API call (except to request a JWT) with a JWT.</span></div><div id="gmail-magicdomid10" class="gmail-"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">* As an API user, I can invalidate all JWT tokens for a given user</span></div><div id="gmail-magicdomid11" class="gmail-"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">* As an authenticated user, when deleting a user 'foo', all of user 'foo's JWTs are invalidated.</span></div><div id="gmail-magicdomid268" class="gmail-ace-line"><span class="gmail-author-a-z71zz70zkz66zki3s0z75zz67z0rlz73zo">* As an </span><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">un-</span><span class="gmail-author-a-z71zz70zkz66zki3s0z75zz67z0rlz73zo">authenticated user, I can obtain </span><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">a</span><span class="gmail-author-a-z71zz70zkz66zki3s0z75zz67z0rlz73zo"> JWT token,</span><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z"> by passing a username and password via POST<br><br></span></div><div id="gmail-magicdomid268" class="gmail-ace-line"><span class="gmail-author-a-4z69zz89z5nz73z6jk2g24z89zz85zz66z">Comments and questions are welcome here. I also hope to append this topic onto one of the upcoming, Tuesday use case calls. The next call May 30th is on the Status API and Alternate Content Sources so hopefully there will be enough time to revisit the JWT use cases then too or on a following call.<br></span></div></div><div><br>[0]: <a href="https://pulp.plan.io/projects/pulp/wiki/Pulp_3_Minimum_Viable_Product#Authentication">https://pulp.plan.io/projects/pulp/wiki/Pulp_3_Minimum_Viable_Product#Authentication</a><br>[1]: <a href="http://getblimp.github.io/django-rest-framework-jwt/">http://getblimp.github.io/django-rest-framework-jwt/</a><br>[2]: <a href="https://pulp.plan.io/issues/2359">https://pulp.plan.io/issues/2359</a><br><br></div>-Brian<br></div>