File tree 4 files changed +22
-4
lines changed
4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ require (
11
11
github.com/hashicorp/terraform-plugin-go v0.25.0
12
12
github.com/hashicorp/terraform-plugin-log v0.9.0
13
13
github.com/iancoleman/strcase v0.3.0
14
- github.com/pomerium/enterprise-client-go v0.28.1-0.20250124224424-4bf492f69b09
14
+ github.com/pomerium/enterprise-client-go v0.28.1-0.20250124233741-2592eb1169f7
15
15
github.com/pomerium/pomerium v0.28.1-0.20250122205906-0bd6d8cc8315
16
16
github.com/rs/zerolog v1.33.0
17
17
github.com/stretchr/testify v1.10.0
Original file line number Diff line number Diff line change @@ -229,8 +229,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
229
229
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
230
230
github.com/pomerium/csrf v1.7.0 h1:Qp4t6oyEod3svQtKfJZs589mdUTWKVf7q0PgCKYCshY =
231
231
github.com/pomerium/csrf v1.7.0 /go.mod h1:hAPZV47mEj2T9xFs+ysbum4l7SF1IdrryYaY6PdoIqw =
232
- github.com/pomerium/enterprise-client-go v0.28.1-0.20250124224424-4bf492f69b09 h1:7728buRUdPGSUMtNP2TRYyxsLfwccp773rFUf9Rxgqc =
233
- github.com/pomerium/enterprise-client-go v0.28.1-0.20250124224424-4bf492f69b09 /go.mod h1:fnT1uLizb7e1aodN9SqSiqg6iYlWoppWFdaPlSR5eKc =
232
+ github.com/pomerium/enterprise-client-go v0.28.1-0.20250124233741-2592eb1169f7 h1:m5rq102yZxD4UWUfyq5M0+butxmhuIeh5STMjMSQzJI =
233
+ github.com/pomerium/enterprise-client-go v0.28.1-0.20250124233741-2592eb1169f7 /go.mod h1:fnT1uLizb7e1aodN9SqSiqg6iYlWoppWFdaPlSR5eKc =
234
234
github.com/pomerium/pomerium v0.28.1-0.20250122205906-0bd6d8cc8315 h1:pdCpEr39m9UomjVkTp17Q4qeTbDZj7yxEffdBXZADe4 =
235
235
github.com/pomerium/pomerium v0.28.1-0.20250122205906-0bd6d8cc8315 /go.mod h1:ujclJDq2BGZuSe2/9Lz2w4MpTVIR8DrR05qyjk1OcsU =
236
236
github.com/pomerium/protoutil v0.0.0-20240813175624-47b7ac43ff46 h1:NRTg8JOXCxcIA1lAgD74iYud0rbshbWOB3Ou4+Huil8 =
Original file line number Diff line number Diff line change @@ -232,3 +232,21 @@ func ToByteSlice(src types.String) []byte {
232
232
}
233
233
return []byte (val )
234
234
}
235
+
236
+ // StringSliceExclude returns a new slice with elements from s1 that are not in s2
237
+ func StringSliceExclude (s1 , s2 []string ) []string {
238
+ if len (s1 ) == 0 || len (s2 ) == 0 {
239
+ return s1
240
+ }
241
+ m := make (map [string ]struct {}, len (s2 ))
242
+ for _ , v := range s2 {
243
+ m [v ] = struct {}{}
244
+ }
245
+ var result []string
246
+ for _ , v := range s1 {
247
+ if _ , ok := m [v ]; ! ok {
248
+ result = append (result , v )
249
+ }
250
+ }
251
+ return result
252
+ }
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ func ConvertRouteFromPB(
117
117
}
118
118
dst .To = types .ListValueMust (types .StringType , toList )
119
119
120
- dst .Policies = FromStringSlice (src .PolicyIds )
120
+ dst .Policies = FromStringSlice (StringSliceExclude ( src .PolicyIds , src . EnforcedPolicyIds ) )
121
121
dst .StatName = types .StringValue (src .StatName )
122
122
dst .Prefix = types .StringPointerValue (src .Prefix )
123
123
dst .Path = types .StringPointerValue (src .Path )
You can’t perform that action at this time.
0 commit comments