[GH-ISSUE #116] Explicitly read from the environment variables with from_env #39

Closed
opened 2026-02-27 20:22:44 +03:00 by kerem · 0 comments
Owner

Originally created by @marioortizmanero on GitHub (Aug 16, 2020).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/116

Calling SpotifyClientCredentials::default() automatically tries to read the environment values for CLIENT_ID and CLIENT_SECRET. I think this shouldn't be the default behavior, meaning that the current default method should become from_env, and have a default method that simply sets the values to None.

This is also done by the tekore library, for example.

This should be done after #109 is taken care of. I have to check if any other structs apart from SpotifyClientCredentials do anything similar.

Originally created by @marioortizmanero on GitHub (Aug 16, 2020). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/116 Calling `SpotifyClientCredentials::default()` [automatically tries to read the environment values for `CLIENT_ID` and `CLIENT_SECRET`](https://github.com/ramsayleung/rspotify/blob/master/src/oauth2.rs#L101). I think this shouldn't be the default behavior, meaning that the current `default` method should become `from_env`, and have a `default` method that simply sets the values to `None`. This is also done by the [tekore](https://tekore.readthedocs.io/en/latest/reference/config.html?highlight=env#tekore.config_from_environment) library, for example. This should be done after #109 is taken care of. I have to check if any other structs apart from `SpotifyClientCredentials` do anything similar.
kerem 2026-02-27 20:22:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#39
No description provided.