Skip to content

Commit f566de5

Browse files
authored
routes: add description, logo_url, source_ppl (#1089)
1 parent 0f11d61 commit f566de5

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
github.com/iancoleman/strcase v0.3.0
1818
github.com/martinlindhe/base36 v1.1.1
1919
github.com/open-policy-agent/opa v1.0.0
20+
github.com/pomerium/csrf v1.7.0
2021
github.com/pomerium/pomerium v0.28.1-0.20250127214108-332d3dc3345e
2122
github.com/rs/zerolog v1.33.0
2223
github.com/sergi/go-diff v1.3.1
@@ -158,7 +159,6 @@ require (
158159
github.com/pkg/errors v0.9.1 // indirect
159160
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
160161
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
161-
github.com/pomerium/csrf v1.7.0 // indirect
162162
github.com/pomerium/datasource v0.18.2-0.20221108160055-c6134b5ed524 // indirect
163163
github.com/pomerium/envoy-custom v1.32.4-0.20250114182541-6f6d2147bea6 // indirect
164164
github.com/pomerium/protoutil v0.0.0-20240813175624-47b7ac43ff46 // indirect

pomerium/ingress_annotations.go

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
envoy_config_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
99
"github.com/open-policy-agent/opa/ast"
10+
"google.golang.org/protobuf/proto"
1011
corev1 "k8s.io/api/core/v1"
1112
"k8s.io/apimachinery/pkg/types"
1213

@@ -24,11 +25,13 @@ var (
2425
"allow_spdy",
2526
"allow_websockets",
2627
"cors_allow_preflight",
28+
"description",
2729
"host_path_regex_rewrite_pattern",
2830
"host_path_regex_rewrite_substitution",
2931
"host_rewrite_header",
3032
"host_rewrite",
3133
"idle_timeout",
34+
"logo_url",
3235
"pass_identity_headers",
3336
"prefix_rewrite",
3437
"preserve_host_header",
@@ -195,6 +198,7 @@ func unmarshalPolicyAnnotations(p *pomerium.Policy, kvs map[string]string) error
195198
return fmt.Errorf("invalid custom rego: %w", err)
196199
}
197200

201+
p.SourcePpl = proto.String(ppl)
198202
p.Rego = []string{src}
199203
return nil
200204
}

pomerium/ingress_annotations_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func TestAnnotations(t *testing.T) {
4646
"a/allowed_idp_claims": `key: ["val1", "val2"]`,
4747
"a/allowed_users": `["a"]`,
4848
"a/cors_allow_preflight": "true",
49+
"a/description": "DESCRIPTION",
4950
"a/health_checks": `[{"timeout": "10s", "interval": "1m", "healthy_threshold": 1, "unhealthy_threshold": 2, "http_health_check": {"path": "/"}}]`,
5051
"a/host_path_regex_rewrite_pattern": "rewrite-pattern",
5152
"a/host_path_regex_rewrite_substitution": "rewrite-sub",
@@ -54,6 +55,7 @@ func TestAnnotations(t *testing.T) {
5455
"a/idle_timeout": `60s`,
5556
"a/kubernetes_service_account_token_secret": "k8s_token",
5657
"a/lb_policy": "LEAST_REQUEST",
58+
"a/logo_url": "LOGO_URL",
5759
"a/least_request_lb_config": `{"choice_count":3,"active_request_bias":{"default_value":4,"runtime_key":"key"},"slow_start_config":{"slow_start_window":"3s","aggression":{"runtime_key":"key"}}}`,
5860
"a/pass_identity_headers": "true",
5961
"a/policy": testPPL,
@@ -187,9 +189,12 @@ func TestAnnotations(t *testing.T) {
187189
AllowedIdpClaims: map[string]*structpb.ListValue{
188190
"key": {Values: []*structpb.Value{structpb.NewStringValue("val1"), structpb.NewStringValue("val2")}},
189191
},
192+
SourcePpl: proto.String(`{"allow":{"or":[{"domain":{"is":"pomerium.com"}}]}}`),
190193
}},
191194
TlsSkipVerify: true,
192195
TlsServerName: "my.server.name",
196+
Description: "DESCRIPTION",
197+
LogoUrl: "LOGO_URL",
193198
}, cmpopts.IgnoreUnexported(
194199
pb.Route{},
195200
pb.RouteRewriteHeader{},

0 commit comments

Comments
 (0)