Skip to content

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.

gbm25 added 2 commits June 14, 2023 18:05
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 Pylyv and TheRustifyer 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