-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Rework provider configuration fields (#3152)
<!-- Feel free to delete comments as you fill this in --> - extract env names - add an entry to migration guide - add tests for invalid configurations - improve validations <!-- summary of changes --> ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests <!-- add more below if you think they are relevant --> * [ ] … ## References <!-- issues documentation links, etc --> ## Open topics - Do we want to move doc helpers to a common package? We could reuse some functions with the `resource` package. ## TODO - add new fields from the doc - more advanced testing will be done in tickets for auth flows and for config hierarchy - use helpers to get values from the schema
- Loading branch information
1 parent
bd11e0f
commit fd6af43
Showing
16 changed files
with
1,017 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package provider | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
const ( | ||
BooleanTrue = "true" | ||
BooleanFalse = "false" | ||
BooleanDefault = "default" | ||
|
||
IntDefault = -1 | ||
IntDefaultString = "-1" | ||
) | ||
|
||
func booleanStringFromBool(value bool) string { | ||
if value { | ||
return BooleanTrue | ||
} else { | ||
return BooleanFalse | ||
} | ||
} | ||
|
||
func BooleanStringToBool(value string) (bool, error) { | ||
switch value { | ||
case BooleanTrue: | ||
return true, nil | ||
case BooleanFalse: | ||
return false, nil | ||
default: | ||
return false, fmt.Errorf("cannot retrieve boolean value from %s", value) | ||
} | ||
} |
Oops, something went wrong.