api secret: allow admin to delete for one or all users #720
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows a user to be found have the admin to revoke their api secret. They can still make it again if they like, but if there is an aup in place they must accept that to remake the api secret. This button can also be handy to disable a key if a site notices what it regards as abuse of the rest api key. In this case it would be assumed to be unintended abuse, such as a compromised key. This is because the key is revoked but the user can remake a key and continue.
There is also a super "delete all api keys" which was added to allow the introduction of an aup which would require everybody to accept the api secret aup in order to start using the rest clients again.
This also leaves off the ESCAPE clause for pgsql, relates to #583. I think perhaps we should be doing the escaping client side rather than asking the database do to things. It seems that the same sort of thing as this ESCAPE can be enabled in pgsql using E'my\tstring' but trying to combine the escape 'E' prefix with parameters to prepared statements was becoming a digression in and of itself. In this case we could expand the tab in the php code and pass the final string to the database in the parameter. Perhaps this was needed in the past when ascii was the default encoding but we could expand citations to unicode characters to the real codepoint these days. For example, the \uxxxx codes from https://www.postgresql.org/docs/current/sql-syntax-lexical.html#id-1.5.3.5.9.5.2