Commit Graph

2 Commits

Author SHA1 Message Date
Helmut K. C. Tessarek d2d07ad345
feat(server): improve random_url config handling (#122)
* feat(server): improve random_url config handling

* log deprecation warnings after hot reload of config

* refactor(config): adjust config files

* tests(config): add test for deprecation codepath

* remove unnecessary to_string()

* style: delete empty line

* refactor(server): clean up random_url config handling

* refactor(config): update configs accordingly to deprecated random_url.enabled

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2023-08-20 20:32:41 +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