Thank you for your interest in contributing to the Global-Tags API! Contributions are welcome and greatly appreciated. There are many ways you can contribute to this project, including reporting issues, submitting bug fixes, adding new features, improving documentation, and more.
- How to Contribute
- Setting Up Your Development Environment
- Implementing a Custom AuthProvider
- Submitting Changes
- License
- Fork the repository.
- Clone your fork.
- Create a branch for your feature or bug fix.
- Implement your changes.
- Push your branch to your fork.
- Submit a pull request.
Please make sure your code adheres to the project's coding standards.
-
Clone the Repository
git clone https://github.com/Global-Tags/API.git cd API
-
Install Dependencies Ensure you have bun installed. Then run:
bun i
The Global-Tags API uses an AuthProvider
class to handle authentication. To extend the authentication mechanism, you can implement your own class that extends src/auth/AuthProvider
.
-
Basic info
Authentication in the GlobalTag-API works like this: The
Authentication
header needs to consist out of two strings. TheAuthProvider
id and the token itself:<id> <token>
What you have to do now is to choose an ID (referred as
YOURID
in the examples) which will be used to direct requests to yourAuthProvider
-
Create a new
AuthProvider
ClassCreate a new file in the
src/auth/providers
directory, for example,<YourClient>Provider.ts
, which extendsAuthProvider
. You need to implement the#getUUID
method and initialize a constructor.import AuthProvider from "../AuthProvider"; export default class YOURSERVICENAMEProvider extends AuthProvider { constructor() { super('YOURID'); } async getUUID(token: string): Promise<string | null> { // Your logic to securely verify the passed token securely. This can be done by requesting an API or verifying a JWT token (Or anything else, it's up to you) // The token does not contain the AuthProvider identifier. } }
-
Test Your Custom AuthProvider
To test your custom AuthProvider you just need to send a
POST
request to/players/<some random uuid>
with the authorization header being<YOURID> <Token>
.
You can then submit the changes by opening a pull request with a clear title and description of your changes.
By contributing to Global-Tags API, you agree that your contributions will be licensed under the MIT License.
Thank you for your contributions! Your efforts help improve the Global-Tags API for everyone.