GithubHelp home page GithubHelp logo

guidojw / arora-api Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 9.79 MB

Backend used to access the Roblox Web API with extra features on top.

License: MIT License

JavaScript 2.89% Shell 5.06% Dockerfile 0.31% TypeScript 91.74%
api roblox

arora-api's People

Contributors

dependabot[bot] avatar depfu[bot] avatar guidojw avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arora-api's Issues

Verify Trello webhook signature

The Trello webhook requests are currently not verified so anyone could send an action to the endpoint and it would show up in the Discord, fix this by verifying the requests using the provided code on the Trello API documentation.

Token Validation Errors

Because none of the requests in Bloxy has disallowedStatusCodes: [403, ...], my PR at Bloxy doesn't change any functionality of the library. Bloxy thinks the status code for Token Validation Errors (403) is allowed and therefore that the request has been executed successfully.

Two possible solution to this problem:

  • Add a new response handler to the RESTController that somehow checks if when the request needed a XCSRF token, it doesn't fail with Token Validation Errors.
  • Add disallowedStatusCodes: [403, ...] to all requests, or find a way to specify this on one place only.

Test these things on my Bloxy fork and PR once it works.

Support HTTPS

Get the certificates worked out and then expose the API on port 443.

Automatically payout train devs

Currently I have to do this manually. The Bloxy library has a wrapper for the Roblox Economy API that will allow a system like this.

This is important to do right the first time so possible check the code several times before merging the PR that implements this system.

Automatically announce trainings

Currently the training shouts aren't really versatile.
Make them include more information and automatically announce them at a specific time every day.

Use cookie pool system

Use the cookie pool system by grilme99 to refresh the cookies and have backup for when a cookie invalidates.

Link

Dynamic Training Types

Add a new training type table to the database and change the training.type's type from enum to a foreign key referencing this new table.

Extending a suspension doesn't work

Days and seconds are getting mixed up in the code, it throws a HTTP 403.
It also interpreted it as a reason change, this is because a lack of proper conditionals.

Update Yarn to v2

Requires #272 to be merged first (so the npm explore ... stuff isn't used in package.json anymore).

Migrate ranks to role IDs

Over a span of time several roles can have the same rank. Due to this, change all the rank columns in the database to roleIds.

Automatic payouts don't work

Ever since enabling the automatic payouts in the train developer payouts job, the reports don't work and the payouts don't actually happen.

Use Sentry for application monitoring

Sentry is a handy tool that can be used to monitor the application by for example having the errors in one place. It can also be connected to a Discord webhook so that people will be notified of errors immediately.

Merge suspensions into bans

Add a duration column to the bans table and merge the suspensions system into the ban system. Rename the suspension_extensions table and make it point at bans instead.

Tests

Implement tests for the code and make Buildkite CI run these.

  • models schema
  • models validation
  • services
  • routes
  • util

Add websocket support

Add websocket support and have the Discord bot connect to that so that when a person's rank changes, the API can tell the Discord bot.

Roblox API for getting join requests now uses pages

The new endpoints of Roblox changed the way some of the methods functioned. The endpoint for getting join requests is one of these, this now uses pages so it only fetches the first page the way I utilise this now. Change so that it goes through all available pages.

Endpoints for logging in and out

For a maybe future UI, implement the following system:

Routes

POST /login/discord?code=AUTHORIZATION_CODE

For logging in with an authorization code retrieved from Discord OAuth2, returns HTTP 200 + HttpOnly cookie including sessionId.

POST /logout

Invalidates cookie.

Authentication

Check if header contains a bearer JWT of which the id is coupled to an application with scope "bot". If it does, authenticate successfully.
Otherwise, check if the request contains a cookie with a JWT token that is valid, then authenticate successfully.

Change authentication to use HTTP headers instead of body

Currently the authentication middleware checks the id and key sent in a request's body. This can however be improved to use the headers of the request so that the GET routes that currently have their required authentication body fields commented out can also be protected.

Clean up routes

There are currently some unnecessary routes,. An example is the get join date route, the join date can also be fetched by using the get user route. Also change the promote endpoint to an update role endpoint that takes any rank.

Fix error handling

Something goes wrong on the server with error handling, see pictures. Looks like the express-async-errors is not working correctly/Sentry catches all errors.
Screenshot_1317
Screenshot_1316

Check if oldRank !== newRank in GroupService.changeRank

Currently the changeRank function in GroupService will resolve successfully even if the rank argument is the same as the user's current rank and thus something like "ADMIN promoted USER from RANK to RANK" where the ranks are the same.
This log message is obviously not useful so check if the new and old rank are the same and don't log if they are.

Style changes

Add a .editorconfig file to indicate editor configurations like what eol and indent-style is used.

Also make decisions about other style changes that can be indicated in the .eslintrc file.
Rules that I've been considering lately:

  • the use of semi colons

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Update Bloxy to v5

Bloxy got updated recently (with docs :D), so update it to the newest version and change the dependency version from linking directly to the dev repository to the actual version number.

I've found a bug with the new version already: the memberCount value is not included in the Group structure. Will submit a PR for that on the Bloxy repository soon.

Set up Continuous Integration/Continuous Deployment

A feature I've been wanting to do for a long time.
This feature would prevent issues like the recent issues with updating Bloxy to v5 from happening.

Options: TravisCI, CircleCI, Buildkite, ...
I think I wanna go for Buildkite as I'm most experienced with that and it seems like they have a free plan that provides my needs.

Steps:

  • Linter
  • Tests (non-existent now, need to work on that).
  • Deploy

This can greatly be used coexistently with Docker.

Noblox.js -> Bloxy

Use the Bloxy npm in order to have access to more Roblox endpoints and to enable multiple clients to be logged in on the API.

Fix some minor database schema problems

The following problems need to be fixed:

  • make user and author IDs columns not nullable again (regression from #170)
  • remove Sequelize-level validations from migrations
  • some date columns that default to Sequelize.NOW only have that set in the model definitions

Support query arguments

Support query arguments for some of the endpoints that are used for getting resources. A query argument that would be nice is for example ?scope=name, which would only fetch resources from the database with given scope.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.