Skip to content

Update settings to have more default values and be able to to override with env variables #1034

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

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

Conversation

bbalser
Copy link
Collaborator

@bbalser bbalser commented Aug 19, 2025

No description provided.

@bbalser bbalser force-pushed the bbalser/better-configs branch from 95344a9 to cfdae3b Compare August 19, 2025 15:53
@michaeldjeffrey michaeldjeffrey force-pushed the bbalser/better-configs branch 3 times, most recently from 4bcdddf to 90426a6 Compare August 19, 2025 21:32
We want to make sure we can provide JSON through env variables.

So we test constructing price::Settings with default values, and the 
rest coming from the environment in the same way starting up a server 
expects them.

- Remove `Settings::tokens()`
  - The field is not correctly parsed when the Settings are parsed.

- Add `temp-env` crate as a dev-dependency
  - his allows us to define environment variables in a test without need
ing to worry about cleanup manually.

- Add `from_json_or_struct` deserializer
  - Takes an env var and parses it as JSON, or the struct it’s expecting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants