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

Api key requests #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Api key requests #6

wants to merge 3 commits into from

Conversation

gbm25
Copy link
Member

@gbm25 gbm25 commented Jun 14, 2023

Important Changes

The following are the most significant changes:

Request Headers

  • Requests must now include an "x-api-key" header with a valid value to access resources.

  • If the request lacks this header, includes multiple headers, or has an incorrect value, a custom error will be returned.

Code Organization

  • The code previously in main.rs has been moved. A new module has been created to better organize endpoints and Rocket's request guards.

Environment Variables

  • Additional dependencies have been added to simplify the use of environment variables.

  • To keep the x-api-key hidden, you must create an .env file with a API_KEY set to the correct value in local/development environments.

Future Use

The code is intended for later use in conjunction with GitHub Action and GitHub secrets.

Before Merging

Please note: These changes should not be merged until the client-side (Flutter app) has been updated to include the x-api-key in requests.

Added control of env variables on compile time.
Hierarchy changes to split the code
@gbm25 gbm25 added enhancement New feature or request help wanted Extra attention is needed labels Jun 14, 2023
@gbm25 gbm25 requested review from TheRustifyer and Pylyv June 14, 2023 20:32
@gbm25 gbm25 self-assigned this Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant