Rewrite /capabilities to Go#3870
Conversation
42fd47e to
2d77065
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
So, I have a number of questions about capabilities:
It seems like "roles" are what really actually to be dynamic -- not capabilities. If you have a user you want to give a limited set of capabilities, you create a new role, add in the capabilities you want to give them, and assign the new role to the user. It doesn't make sense to create a new capability via the API or update or delete existing capabilities. IMO it really only makes sense to be able to read the statically defined capabilities, so that you have the full set to choose from. |
In any case, such deprecations probably need to go to the mailing list for discussion. I don't disagree that this could be handled better - possibly by requiring extensions to define a governing capability? - but I do want to just get the route into Go, since deprecation takes a full major release cycle anyway. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Ah, I see now that Good point about the arbitrary endpoints via extensions. I don't really like the idea of making all the built-in capabilities mutable though. It has all the same issues as making built-in |
8b3b6b8 to
46a5fec
Compare
No, but it should. We should add a migration to change |
|
Refer to this link for build results (access rights to CI server needed): |
It can, depends if the foreign key constraint was defined with Extensions certainly have access to the database at runtime, but idk if they do at startup. |
|
Oh, rob05c beat me to it. But also of note while we're looking, the Role/Capability relationship has the same problem. |
Yes. TO Plugins can access anything the main TO app can. If a hook can't access something that's needed, it can be added to the
Same goes for startup, needed data (like the |
|
Well, if we make the built-in capabilities immutable the Since capabilities aren't really used in the code yet, I think we have some freedom to design them properly before we get stuck in the rut of having to support unnecessary API endpoints. |
|
The best we could do in that direction is return an error without breaking the "API version promise". And actually, that might qualify; not sure. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
d464a1b to
f0d013a
Compare
|
Refer to this link for build results (access rights to CI server needed): |
6c19516 to
8eba7e7
Compare
What does this PR (Pull Request) do?
Rewrites the
/capabilitiesendpoint to Go. Also adds handlers for thePUTandDELETErequest methods.Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Run the associated tests in
traffic_ops/testing/api/v14.The following criteria are ALL met by this PR