You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, errors.New("Invalid provider configuration. Either Connect credentials (\"token\" and \"url\") or Service Account (\"service_account_token\" or \"account\") credentials should be set.")
44
+
returnnil, errors.New("Invalid provider configuration. Either Connect credentials (\"connect_token\" and \"connect_url\") or Service Account (\"service_account_token\") or \"account\" should be set.")
MarkdownDescription: "The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment variable. Provider will use 1Password Connect server if set.",
48
54
Optional: true,
49
55
},
50
-
"token": schema.StringAttribute{
56
+
"connect_token": schema.StringAttribute{
51
57
MarkdownDescription: "A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. Provider will use 1Password Connect server if set.",
52
58
Optional: true,
53
59
Sensitive: true,
54
60
},
61
+
"url": schema.StringAttribute{
62
+
MarkdownDescription: "The HTTP(S) URL where your 1Password Connect server can be found. Can also be sourced `OP_CONNECT_HOST` environment variable. Provider will use 1Password Connect server if set. Deprecated: Use `connect_url` instead.",
63
+
Optional: true,
64
+
Validators: []validator.String{
65
+
stringvalidator.ConflictsWith(
66
+
path.Expressions{
67
+
path.MatchRoot("connect_url"),
68
+
}...,
69
+
),
70
+
},
71
+
DeprecationMessage: "The \"url\" field is deprecated and will be removed in a future version. Use \"connect_url\" instead.",
72
+
},
73
+
"token": schema.StringAttribute{
74
+
MarkdownDescription: "A valid token for your 1Password Connect server. Can also be sourced from `OP_CONNECT_TOKEN` environment variable. Provider will use 1Password Connect server if set. Deprecated: Use `connect_token` instead.",
75
+
Optional: true,
76
+
Sensitive: true,
77
+
Validators: []validator.String{
78
+
stringvalidator.ConflictsWith(
79
+
path.Expressions{
80
+
path.MatchRoot("connect_token"),
81
+
}...,
82
+
),
83
+
},
84
+
DeprecationMessage: "The \"token\" field is deprecated and will be removed in a future version. Use \"connect_token\" instead.",
85
+
},
55
86
"service_account_token": schema.StringAttribute{
56
87
MarkdownDescription: "A valid 1Password service account token. Can also be sourced from `OP_SERVICE_ACCOUNT_TOKEN` environment variable.",
// the other one is prompted for, but Terraform then forgets the value for the one that
101
141
// is defined in the code. This confusing user-experience can be avoided by handling the
102
142
// requirement of one of the attributes manually.
103
-
//
104
-
// TODO: Investigate if wrapping this as a (framework) validator can be a better fit.
105
143
ifserviceAccountToken!=""||account!="" {
106
144
ifconnectToken!=""||connectHost!="" {
107
145
resp.Diagnostics.AddError("Config conflict", "Either Connect credentials (\"connect_token\" and \"connect_url\") or \"service_account_token\" or \"account\" can be set. Multiple are set. Only one credential must be set.")
0 commit comments