Skip to content

Commit f154a77

Browse files
committed
update API dependency, fix up tests
1 parent a60ac7b commit f154a77

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/terraform-plugin-go v0.25.0
1212
github.com/hashicorp/terraform-plugin-log v0.9.0
1313
github.com/iancoleman/strcase v0.3.0
14-
github.com/pomerium/enterprise-client-go v0.28.1-0.20250310151140-91b9684b1537
14+
github.com/pomerium/enterprise-client-go v0.28.1-0.20250313205349-eaa1c8257711
1515
github.com/pomerium/pomerium v0.28.1-0.20250313134608-c4a5502f49f5
1616
github.com/rs/zerolog v1.33.0
1717
github.com/stretchr/testify v1.10.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
7878
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7979
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
8080
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
81-
github.com/pomerium/enterprise-client-go v0.28.1-0.20250310151140-91b9684b1537 h1:5zM4pm7dPXWMx2Eq0G7XuoQJV5gZqMbjiWjRq6YH5Ws=
82-
github.com/pomerium/enterprise-client-go v0.28.1-0.20250310151140-91b9684b1537/go.mod h1:36+cCZpNgJQb5B1+y4rCcyQ8CM865NBNmEAQFS+73DQ=
81+
github.com/pomerium/enterprise-client-go v0.28.1-0.20250313205349-eaa1c8257711 h1:T6hLEgz5RAqKVJ2+gaRx9U1Rqlrbiii+jwBDqVh7QxM=
82+
github.com/pomerium/enterprise-client-go v0.28.1-0.20250313205349-eaa1c8257711/go.mod h1:36+cCZpNgJQb5B1+y4rCcyQ8CM865NBNmEAQFS+73DQ=
8383
github.com/pomerium/pomerium v0.28.1-0.20250313134608-c4a5502f49f5 h1:J7uXUwA8vk1O0sD9lkgi6H9v8lxXVaoH3rIJZ8+Arpw=
8484
github.com/pomerium/pomerium v0.28.1-0.20250313134608-c4a5502f49f5/go.mod h1:AR7TsCCxEbz1ZLKRPJSrmBHRqPewjPEac2LXsFTc/08=
8585
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=

internal/provider/route_model.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ func ConvertRouteToPB(
590590
pbRoute.EnableGoogleCloudServerlessAuthentication = src.EnableGoogleCloudServerlessAuthentication.ValueBool()
591591
}
592592
pbRoute.KubernetesServiceAccountTokenFile = src.KubernetesServiceAccountTokenFile.ValueStringPointer()
593-
EnumValueToPBWithDefault(&pbRoute.JwtIssuerFormat, src.JWTIssuerFormat, pb.IssuerFormat_IssuerHostOnly, &diagnostics)
593+
pbRoute.JwtIssuerFormat = ToIssuerFormat(src.JWTIssuerFormat)
594594
pbRoute.RewriteResponseHeaders = rewriteHeadersToPB(src.RewriteResponseHeaders)
595595
pbRoute.BearerTokenFormat = ToBearerTokenFormat(src.BearerTokenFormat)
596596
ToRouteStringList(ctx, &pbRoute.IdpAccessTokenAllowedAudiences, src.IDPAccessTokenAllowedAudiences, &diagnostics)
@@ -652,7 +652,7 @@ func ConvertRouteFromPB(
652652
dst.EnableGoogleCloudServerlessAuthentication = types.BoolValue(true)
653653
}
654654
dst.KubernetesServiceAccountTokenFile = types.StringPointerValue(src.KubernetesServiceAccountTokenFile)
655-
dst.JWTIssuerFormat = EnumValueFromPB(src.JwtIssuerFormat)
655+
dst.JWTIssuerFormat = FromIssuerFormat(src.JwtIssuerFormat)
656656
dst.RewriteResponseHeaders = rewriteHeadersFromPB(src.RewriteResponseHeaders)
657657
dst.BearerTokenFormat = FromBearerTokenFormat(src.BearerTokenFormat)
658658
dst.IDPAccessTokenAllowedAudiences = FromStringList(src.IdpAccessTokenAllowedAudiences)

internal/provider/route_model_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestConvertRoute(t *testing.T) {
6262
LogoUrl: ptr("https://logo.example.com/logo.png"),
6363
EnableGoogleCloudServerlessAuthentication: true,
6464
KubernetesServiceAccountTokenFile: ptr("/path/to/token"),
65-
JwtIssuerFormat: pb.IssuerFormat_IssuerURI,
65+
JwtIssuerFormat: pb.IssuerFormat_IssuerURI.Enum(),
6666
BearerTokenFormat: pb.BearerTokenFormat_BEARER_TOKEN_FORMAT_IDP_ACCESS_TOKEN.Enum(),
6767
IdpAccessTokenAllowedAudiences: &pb.Route_StringList{Values: []string{"aud1", "aud2"}},
6868
LoadBalancingPolicy: pb.LoadBalancingPolicy_LOAD_BALANCING_POLICY_ROUND_ROBIN.Enum(),
@@ -186,7 +186,7 @@ func TestConvertRoute(t *testing.T) {
186186
LogoURL: types.StringValue("https://logo.example.com/logo.png"),
187187
EnableGoogleCloudServerlessAuthentication: types.BoolValue(true),
188188
KubernetesServiceAccountTokenFile: types.StringValue("/path/to/token"),
189-
JWTIssuerFormat: types.StringValue("IssuerURI"),
189+
JWTIssuerFormat: types.StringValue("uri"),
190190
BearerTokenFormat: types.StringValue("idp_access_token"),
191191
IDPAccessTokenAllowedAudiences: types.SetValueMust(types.StringType, []attr.Value{types.StringValue("aud1"), types.StringValue("aud2")}),
192192
LoadBalancingPolicy: types.StringValue("round_robin"),

internal/provider/settings_model_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func TestConvertSettingsToPB(t *testing.T) {
7272
InstallationId: proto.String("INSTALLATION_ID"),
7373
JwtClaimsHeaders: map[string]string{"X": "Y"},
7474
JwtGroupsFilter: &pb.JwtGroupsFilter{InferFromPpl: proto.Bool(true), Groups: []string{"z"}},
75+
JwtIssuerFormat: pb.IssuerFormat_IssuerURI.Enum(),
7576
LogLevel: proto.String("debug"),
7677
LogoUrl: proto.String("https://logo.example.com"),
7778
MetricsAddress: proto.String("127.0.0.1:9999"),
@@ -139,6 +140,7 @@ func TestConvertSettingsToPB(t *testing.T) {
139140
InstallationID: types.StringValue("INSTALLATION_ID"),
140141
JWTClaimsHeaders: types.MapValueMust(types.StringType, map[string]attr.Value{"X": types.StringValue("Y")}),
141142
JWTGroupsFilter: types.ObjectValueMust(map[string]attr.Type{"infer_from_ppl": types.BoolType, "groups": types.ListType{ElemType: types.StringType}}, map[string]attr.Value{"infer_from_ppl": types.BoolValue(true), "groups": types.ListValueMust(types.StringType, []attr.Value{types.StringValue("z")})}),
143+
JWTIssuerFormat: types.StringValue("uri"),
142144
LogLevel: types.StringValue("debug"),
143145
LogoURL: types.StringValue("https://logo.example.com"),
144146
MetricsAddress: types.StringValue("127.0.0.1:9999"),

0 commit comments

Comments
 (0)