Skip to content

Commit

Permalink
update provider validation
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Nov 16, 2023
1 parent 4af1638 commit 80e721a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ func (p *PluralProvider) Schema(_ context.Context, _ provider.SchemaRequest, res
MarkdownDescription: "Plural Console URL, i.e. `https://console.demo.onplural.sh`. Can be sourced from `PLURAL_CONSOLE_URL`.",
Optional: true,
Validators: []validator.String{
stringvalidator.AlsoRequires(path.MatchRoot("access_token")),
stringvalidator.ConflictsWith(path.MatchRoot("use_cli")),
stringvalidator.ExactlyOneOf(path.MatchRoot("use_cli")),
},
},
"access_token": schema.StringAttribute{
MarkdownDescription: "Plural Console access token. Can be sourced from `PLURAL_ACCESS_TOKEN`.",
Optional: true,
Sensitive: true,
Validators: []validator.String{
stringvalidator.AlsoRequires(path.MatchRoot("console_url")),
stringvalidator.ConflictsWith(path.MatchRoot("use_cli")),
stringvalidator.ExactlyOneOf(path.MatchRoot("use_cli")),
},
},
"use_cli": schema.BoolAttribute{
Expand All @@ -71,8 +71,6 @@ func (p *PluralProvider) Schema(_ context.Context, _ provider.SchemaRequest, res
path.MatchRoot("console_url"),
path.MatchRoot("access_token"),
),
boolvalidator.ExactlyOneOf(path.MatchRoot("console_url")),
boolvalidator.ExactlyOneOf(path.MatchRoot("access_token")),
},
},
},
Expand Down

0 comments on commit 80e721a

Please sign in to comment.