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

Autohost to generic bots #562

Merged

Conversation

geekingfrog
Copy link
Contributor

This is mostly a big refactoring PR, tidying up some lose ends around OAuth.
The main changes are:

  • make some oauth application only available for the client credential flow, so one cannot use a personal login on the website to get a code then a token. This is meant so we can have a dedicated app(s) to manage bots
  • rename autohost into bot in the context of authentication. So we can use the same mechanism to create autohost or bot accounts.

The next part coming will be to modify the api endpoints to accept authentication with bearer token, and create an endpoint so that a bot with the correct scope can update the map data in teiserver.

@geekingfrog geekingfrog force-pushed the autohost-to-generic-bots branch 3 times, most recently from 7f53263 to 23bac28 Compare January 26, 2025 18:11
@geekingfrog geekingfrog marked this pull request as ready for review January 26, 2025 18:42
It is enough to block the creation of code since you must get a one to
get a token.
Now that we are going to have more than one total scope, we need logic
to avoid permission bypass.
Although the concept of autohost remains, the general handling of bots
with regards to credentials shouldn't be tied to autohosts.
This enable having bots to access the API using bearer token in a
unified way.

This rather massive change is mostly only a search and replace
`s/autohost/bot/`. Some things are staying as they are:
* `Teiserver.Autohost` remains because it's used for tachyon and
  matchmaking
* the table `oauth_tokens` still has a column `autohost_id`, the
  migration will be done in a later commit. Migrations can be tricky and
  keeping these changes to their own commits is safer.
This completes the renaming from autohost to bot
@geekingfrog geekingfrog force-pushed the autohost-to-generic-bots branch from 32d006f to 9f777ad Compare January 28, 2025 20:22
@L-e-x-o-n L-e-x-o-n merged commit e1efded into beyond-all-reason:master Jan 31, 2025
3 checks passed
@geekingfrog geekingfrog deleted the autohost-to-generic-bots branch January 31, 2025 20:57
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.

2 participants