Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add access token and throttled application models to Django admin #3711

Closed
AetherUnbound opened this issue Jan 26, 2024 · 2 comments · Fixed by #3836
Closed

Add access token and throttled application models to Django admin #3711

AetherUnbound opened this issue Jan 26, 2024 · 2 comments · Fixed by #3836
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API

Comments

@AetherUnbound
Copy link
Contributor

Problem

When investigating traffic patterns and addressing malicious API usage, it can be useful to use the Django Admin web UI to check the status of an access token and/or client application.

Description

We should add the oauth_provider.models.AccessToken and api.models.oauth.ThrottledApplication tables to the Django Admin UI so that these records can be easily accessed and searched against from the web UI.

class ThrottledApplication(AbstractApplication):

Those models will need their own views added to admin.__init__:

https://github.com/WordPress/openverse/blob/5e5a2aa376048391a8455ae3063b4f3e7afe0d0d/api/api/admin/__init__.py

While I initially thought this would be good as read-only, we might even want to enable editing of certain fields so that access can be revoked by maintainers using the Admin UI as well.

Alternatives

Additional context

@AetherUnbound AetherUnbound added good first issue New-contributor friendly help wanted Open to participation from the community 🌟 goal: addition Addition of new feature 💻 aspect: code Concerns the software code in the repository 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API labels Jan 26, 2024
@bjornthiberg
Copy link
Contributor

bjornthiberg commented Feb 26, 2024

Hi,

We are a group of 5 students at KTH. As a part of a Software Engineering course we are to solve an issue for an open-source project. Ok if we attempt this one? :) @WordPress/openverse-maintainers @AetherUnbound

/ @bjornthiberg @samshahriari @torenylen @Oozna @Samkth123

@AetherUnbound
Copy link
Contributor Author

Hi @bjornthiberg and others! We'd love to have y'all help contribute to the project 😄 I'll go ahead and assign it to you. Please check out our welcome and quickstart documentation pages, and if you have any questions about this issue feel free to leave them here!

bjornthiberg added a commit to group19-se24/assignment-4 that referenced this issue Feb 27, 2024
Co-authored-by: Tore Nylén <toreny@kth.se>
Co-authored-by: Oozna <66669398+Oozna@users.noreply.github.com>
Co-authored-by: Sam Shahriari <62112476+samshahriari@users.noreply.github.com>
Co-authored-by: Sam <80268884+Samkth123@users.noreply.github.com>
bjornthiberg added a commit to group19-se24/assignment-4 that referenced this issue Mar 14, 2024
bjornthiberg added a commit to group19-se24/assignment-4 that referenced this issue Mar 14, 2024
krysal pushed a commit that referenced this issue Mar 18, 2024
Co-authored-by: Tore Nylén <toreny@kth.se>
Co-authored-by: Oozna <66669398+Oozna@users.noreply.github.com>
Co-authored-by: Sam Shahriari <62112476+samshahriari@users.noreply.github.com>
Co-authored-by: Sam <80268884+Samkth123@users.noreply.github.com>
krysal pushed a commit that referenced this issue Mar 18, 2024
AetherUnbound pushed a commit that referenced this issue Mar 19, 2024
* Add accesstoken and ThrottledApplication to admin panel (#3711)

Co-authored-by: Tore Nylén <toreny@kth.se>
Co-authored-by: Oozna <66669398+Oozna@users.noreply.github.com>
Co-authored-by: Sam Shahriari <62112476+samshahriari@users.noreply.github.com>
Co-authored-by: Sam <80268884+Samkth123@users.noreply.github.com>

* resolve import merge conflict (#5711)

* resolve review comments (#3711)

* make rate_limit_model searchable (#3711)

---------

Co-authored-by: Tore Nylén <toreny@kth.se>
Co-authored-by: Oozna <66669398+Oozna@users.noreply.github.com>
Co-authored-by: Sam Shahriari <62112476+samshahriari@users.noreply.github.com>
Co-authored-by: Sam <80268884+Samkth123@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🌟 goal: addition Addition of new feature good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants