Commit Graph

10 Commits

Author SHA1 Message Date
Helmut K. C. Tessarek ec9b55f3e2
fix(auth): remove excessive warning and typo (#210) 2023-12-20 18:47:51 +01:00
Artem Medvedev e21f99ac4a
refactor(server)!: cleanup authorization boilerplate (#199)
* refactor!: use `actix-web-grants` to protect endpoints

* fix: filter out blank strings

* doc: add documentation for a function

* fix: don't return body for not exposed endpoints

* test: add fixtures

* test: fix naming

* test: remove extra step in teardown
2023-12-12 19:21:29 +01:00
Orhun Parmaksız ef08b9e838
refactor(tracing): use macros from tracing crate 2023-12-05 15:12:48 +03:00
Jean SIMARD 70541bb842
feat(log): switch to `tracing` for logging (#163)
* feat(log): use 'tracing-subscriber' instead of 'env_logger'

resolves #161

* feat: use 'tracing' instead of 'log'

* feat: make 'INFO' the default log level
2023-10-20 23:30:16 +02:00
Helmut K. C. Tessarek 9145c46e18
fix(server): don't log invalid token in release builds (#112)
* fix(server): don't log invalid token in release builds

* refactor(auth): use inline formatting for auth logs

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2023-08-14 14:05:34 +02:00
Helmut K. C. Tessarek 33e038cd4b
style(server): add new line char to most prominent messages (#97) 2023-07-22 10:12:04 +02:00
Helmut K. C. Tessarek 0d4808880f
feat(server): support multiple auth tokens (#84)
* feat(server): support multiple auth tokens

Example:

```toml
[server]
auth_tokens = [
  "super_secret_token1",
  "super_secret_token2",
]
```

The previously used `AUTH_TOKEN` environment variable can still be used
and will be evaluated as well.

* fixtures: add all tokens in array to the test

* add deprecation warning for auth_token

* also add deprecation warnings at server startup

* fix formatting

* fixed tests, so that we do not use deprecated config options

* use bash array

* refactor: use separate function

* refactor: check auth tokens

* Update fixtures/test-server-auth-multiple-tokens/test.sh

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>

* refactor: convert functions to methods

* refactor: check function

* refactor: get_tokens method

* style(format): add newline between functions

* refactor(server): print deprecation warnings once

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2023-07-21 12:28:17 +02:00
Orhun Parmaksız c48e45d68c
chore(deps): upgrade actix dependencies
closes #18
2022-03-17 15:46:32 +03:00
orhun cc385d1aca
refactor(test): use `tests` module for tests 2021-08-09 22:50:01 +03:00
orhun 12c204bf03
refactor(server): create auth handler module 2021-07-24 14:38:53 +03:00