Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAudit trail for more owner actions #1548
Comments
This comment has been minimized.
This comment has been minimized.
hinchley2018
commented
Dec 3, 2018
•
|
@carols10cents This sounds like a fun issue to sink my teeth into. |
This comment has been minimized.
This comment has been minimized.
|
I don't mind at all, and no, there's no deadline! |
bors-voyager bot
added a commit
that referenced
this issue
Dec 3, 2018
This was referenced Jan 21, 2019
carols10cents
changed the title
Audit trail for more actions
Audit trail for more owner actions
Feb 14, 2019
markcatley
referenced this issue
Mar 31, 2019
Open
Add audit trail to the publish, yank and unyank transactions. #1700
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
carols10cents commentedNov 1, 2018
•
edited
Further steps beyond #1478. These changes wouldn't be exposed in the UI but would be in the database for us to use in determining who took what actions when.
Add a column to the api_tokens table named
revokedthat's a BOOLEAN NOT NULL DEFAULT 'f'. Then instead of deleting tokens, mark them as revoked.Create a migration (using
diesel migration generate, as explained in this guide) that adds a new table namedversion_owner_actionswith the following columns:Keep the headers[0] authorization header value accessible by holding onto it in the
AuthenticationSource::ApiTokenvariantWithin the crate publish transaction, after the new version record is created, create a new version owner action record with action = "publish", version_id = version.id, owner_id = user.id, owner_token = req.authentication_source() (and then extract the
token value)
Make similar changes to add records to the activity table in yank and unyank
Add a field to EncodableVersion that's a Vec of all the actions, owner ids, and times that this version has had an action taken on it so that this info, minus the api token value, is returned in the API response
Add a table crate_owners_actions that records who adds and removes other owners from a crate
Add tests that this information is being recorded and returned as expected