Skip to content

Commit cbe1adf

Browse files
committed
Updates from review
1 parent f3f381e commit cbe1adf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/dev/design/secure-api-access-from-builders.rst

+7
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ since we can re-use the code from knox package.
102102

103103
Attaching tokens to projects only is possible,
104104
but it will require to manage the authentication manually.
105+
This is since Knox requires a user to be attached to the token,
106+
and this user is used in their ``TokenAuthentication`` class.
107+
An alternative is to use the DRF API key package, which doesn't require a user,
108+
but then if we wanted to extend this functionality to our normal APIs, we will have
109+
to implement the authentication manually.
105110

106111
Kepping backwards compatibility
107112
-------------------------------
@@ -121,6 +126,8 @@ There is a race condition when using the token,
121126
and the user that is attached to that token is removed from the project.
122127
This is, if the user is removed while the build is running,
123128
the builders won't be able to access the API.
129+
We could avoid this by not relying on the user attached to the token,
130+
only on the projects attached to it (this would be for our build APIs only).
124131

125132
Alternative implementation with Django REST Framework API Key
126133
-------------------------------------------------------------

0 commit comments

Comments
 (0)