Skip to content

Change blacklisted -> denied for inclusivity#342

Merged
Digbigpig merged 1 commit intomainfrom
ditch-racism
Jul 18, 2020
Merged

Change blacklisted -> denied for inclusivity#342
Digbigpig merged 1 commit intomainfrom
ditch-racism

Conversation

@aaron-junot
Copy link
Copy Markdown
Member

The word blacklist isn't a very inclusive term. I think that denylist is a much better term to use, and besides, it's more descriptive for what we're doing to the API key.

This PR involves a DB migration and also has everything to do with our authentication, so please give it a solid review. To run the migration locally, you should be able to run make migrate. Let me know if this doesn't work, because we'll want to fix that command. And of course, let me know if you run into any issues.

Testing:

  1. Get your API key with the /apikey endpoint
  2. Use the API key to successfully add a resource with POST /resources
  3. Use the API key to successfully update a resource with PUT /resources
  4. Deny your API key using docker-compose run resources-api flask apikey deny <email address> (can also pass in API key instead of email address)
  5. Ensure you can't get your API key from the /apikey endpoint after it's been put on the denylist
  6. Ensure you can't make a POST or PUT request to the /resources endpoint with your denied API key
  7. Reactivate your API key using docker-compose run resources-api flask apikey reactivate <email address> (can also pass in API key instead of email address)
  8. Get your API key again and make sure you're allowed to make POST requests again.

@aaron-junot
Copy link
Copy Markdown
Member Author

@jamesfitzer I can't add you as a reviewer until you accept the invite to collaborate, but would you mind also taking a look when you get a chance?

@jamesfitzer
Copy link
Copy Markdown
Collaborator

jamesfitzer commented Jul 4, 2020 via email

@jamesfitzer
Copy link
Copy Markdown
Collaborator

Ok should be good now

@aaron-junot aaron-junot requested a review from jamesfitzer July 4, 2020 20:03
Comment thread migrations/versions/205742d3b3f5_change_blacklist_to_deny.py Outdated
jamesfitzer
jamesfitzer previously approved these changes Jul 7, 2020
Copy link
Copy Markdown
Collaborator

@jamesfitzer jamesfitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than toadzky's comment, I don't see any issues here. If nobody is denied right now, the migration issue might be superfluous but it's nice to do it in the interests of correctness/completeness.

Nice clean single issue PR. Good work


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('key', 'blacklisted', new_column_name='denied')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested out upgrading and downgrading with a denied key, and it kept the attribute both ways with this, so I think we're good on that now.

@aaron-junot
Copy link
Copy Markdown
Member Author

Reviews were dismissed because I had to rebase to get back up to date with main but the content of the PR is the same. Just need an approval and merge 👍

Copy link
Copy Markdown
Collaborator

@Digbigpig Digbigpig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Digbigpig Digbigpig merged commit 1c88d63 into main Jul 18, 2020
@Digbigpig Digbigpig deleted the ditch-racism branch July 18, 2020 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants