Skip to content
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

Add environment variable to override cloud_allowunverified_expansions #978

Merged

Conversation

JulianVennen
Copy link
Contributor

@JulianVennen JulianVennen commented Jun 23, 2023

Pull Request

Type

  • Internal change (Doesn't affect end-user).
  • External change (Does affect end-user).
  • Wiki (Changes towards the Wiki).
  • Other: __________

Description

This pull request adds the environment variable PAPI_ALLOW_UNVERIFIED_EXPANSIONS.
It allows overriding the option set in the config.yml.

Accepted values are (case-insensitive) true, yes and 1 to allow expansions or false, no and 0 to forbid them.
If the environment variable is not set or the value is not valid, the value specified in the config.yml will be used.

If the value is set to true unverified expansions will be allowed (case-insensitive), if it is set to any other value, unverified expansions will be forbidden.

This adds the environment variable PAPI_ALLOW_UNVERIFIED_EXPANSIONS.
It allows overriding the option set in the config.yml.
@Andre601
Copy link
Collaborator

Nice idea, tho I personally feel like supporting all these specific options for what is basically true/false is not needed.
Just allow true false and then use env.equalsIgnoreCase("true") to check.

@JulianVennen
Copy link
Contributor Author

Nice idea, tho I personally feel like supporting all these specific options for what is basically true/false is not needed. Just allow true false and then use env.equalsIgnoreCase("true") to check.

That would also be ok with me, I could make the change to that if requested

@iGabyTM
Copy link
Member

iGabyTM commented Jun 23, 2023

There is also this shortcut https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html#getBoolean-java.lang.String-
And I agree with Andre, true and false are enough.

@Andre601
Copy link
Collaborator

There is also this shortcut https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html#getBoolean-java.lang.String-
And I agree with Andre, true and false are enough.

That method is just return value.equalsIgnoreCase("true"); xD

@PiggyPiglet PiggyPiglet merged commit 5623a00 into PlaceholderAPI:master Sep 21, 2023
@Andre601 Andre601 added Type: Enhancement New feature or request Target: Code This issue/PR is targeting the Code of PlaceholderAPI labels Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Target: Code This issue/PR is targeting the Code of PlaceholderAPI Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants