forked from joeholley/supergloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolicy.pb.go
1977 lines (1846 loc) · 60.6 KB
/
policy.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/solo-io/supergloo/api/external/istio/authorization/v1alpha1/policy.proto
// This package defines user-facing authentication policy.
package v1alpha1
import (
bytes "bytes"
fmt "fmt"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Associates authentication with request principal.
type PrincipalBinding int32
const (
// Principal will be set to the identity from peer authentication.
PrincipalBinding_USE_PEER PrincipalBinding = 0
// Principal will be set to the identity from origin authentication.
PrincipalBinding_USE_ORIGIN PrincipalBinding = 1
)
var PrincipalBinding_name = map[int32]string{
0: "USE_PEER",
1: "USE_ORIGIN",
}
var PrincipalBinding_value = map[string]int32{
"USE_PEER": 0,
"USE_ORIGIN": 1,
}
func (x PrincipalBinding) String() string {
return proto.EnumName(PrincipalBinding_name, int32(x))
}
func (PrincipalBinding) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{0}
}
// Defines the acceptable connection TLS mode.
type MutualTls_Mode int32
const (
// Client cert must be presented, connection is in TLS.
MutualTls_STRICT MutualTls_Mode = 0
// Connection can be either plaintext or TLS, and client cert can be omitted.
MutualTls_PERMISSIVE MutualTls_Mode = 1
)
var MutualTls_Mode_name = map[int32]string{
0: "STRICT",
1: "PERMISSIVE",
}
var MutualTls_Mode_value = map[string]int32{
"STRICT": 0,
"PERMISSIVE": 1,
}
func (x MutualTls_Mode) String() string {
return proto.EnumName(MutualTls_Mode_name, int32(x))
}
func (MutualTls_Mode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{1, 0}
}
// Describes how to match a given string. Match is case-sensitive.
type StringMatch struct {
// Types that are valid to be assigned to MatchType:
// *StringMatch_Exact
// *StringMatch_Prefix
// *StringMatch_Suffix
// *StringMatch_Regex
MatchType isStringMatch_MatchType `protobuf_oneof:"match_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StringMatch) Reset() { *m = StringMatch{} }
func (m *StringMatch) String() string { return proto.CompactTextString(m) }
func (*StringMatch) ProtoMessage() {}
func (*StringMatch) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{0}
}
func (m *StringMatch) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StringMatch.Unmarshal(m, b)
}
func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic)
}
func (m *StringMatch) XXX_Merge(src proto.Message) {
xxx_messageInfo_StringMatch.Merge(m, src)
}
func (m *StringMatch) XXX_Size() int {
return xxx_messageInfo_StringMatch.Size(m)
}
func (m *StringMatch) XXX_DiscardUnknown() {
xxx_messageInfo_StringMatch.DiscardUnknown(m)
}
var xxx_messageInfo_StringMatch proto.InternalMessageInfo
type isStringMatch_MatchType interface {
isStringMatch_MatchType()
Equal(interface{}) bool
}
type StringMatch_Exact struct {
Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof"`
}
type StringMatch_Prefix struct {
Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"`
}
type StringMatch_Suffix struct {
Suffix string `protobuf:"bytes,3,opt,name=suffix,proto3,oneof"`
}
type StringMatch_Regex struct {
Regex string `protobuf:"bytes,4,opt,name=regex,proto3,oneof"`
}
func (*StringMatch_Exact) isStringMatch_MatchType() {}
func (*StringMatch_Prefix) isStringMatch_MatchType() {}
func (*StringMatch_Suffix) isStringMatch_MatchType() {}
func (*StringMatch_Regex) isStringMatch_MatchType() {}
func (m *StringMatch) GetMatchType() isStringMatch_MatchType {
if m != nil {
return m.MatchType
}
return nil
}
func (m *StringMatch) GetExact() string {
if x, ok := m.GetMatchType().(*StringMatch_Exact); ok {
return x.Exact
}
return ""
}
func (m *StringMatch) GetPrefix() string {
if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok {
return x.Prefix
}
return ""
}
func (m *StringMatch) GetSuffix() string {
if x, ok := m.GetMatchType().(*StringMatch_Suffix); ok {
return x.Suffix
}
return ""
}
func (m *StringMatch) GetRegex() string {
if x, ok := m.GetMatchType().(*StringMatch_Regex); ok {
return x.Regex
}
return ""
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*StringMatch) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _StringMatch_OneofMarshaler, _StringMatch_OneofUnmarshaler, _StringMatch_OneofSizer, []interface{}{
(*StringMatch_Exact)(nil),
(*StringMatch_Prefix)(nil),
(*StringMatch_Suffix)(nil),
(*StringMatch_Regex)(nil),
}
}
func _StringMatch_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*StringMatch)
// match_type
switch x := m.MatchType.(type) {
case *StringMatch_Exact:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Exact)
case *StringMatch_Prefix:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Prefix)
case *StringMatch_Suffix:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Suffix)
case *StringMatch_Regex:
_ = b.EncodeVarint(4<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Regex)
case nil:
default:
return fmt.Errorf("StringMatch.MatchType has unexpected type %T", x)
}
return nil
}
func _StringMatch_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*StringMatch)
switch tag {
case 1: // match_type.exact
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.MatchType = &StringMatch_Exact{x}
return true, err
case 2: // match_type.prefix
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.MatchType = &StringMatch_Prefix{x}
return true, err
case 3: // match_type.suffix
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.MatchType = &StringMatch_Suffix{x}
return true, err
case 4: // match_type.regex
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.MatchType = &StringMatch_Regex{x}
return true, err
default:
return false, nil
}
}
func _StringMatch_OneofSizer(msg proto.Message) (n int) {
m := msg.(*StringMatch)
// match_type
switch x := m.MatchType.(type) {
case *StringMatch_Exact:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Exact)))
n += len(x.Exact)
case *StringMatch_Prefix:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Prefix)))
n += len(x.Prefix)
case *StringMatch_Suffix:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Suffix)))
n += len(x.Suffix)
case *StringMatch_Regex:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Regex)))
n += len(x.Regex)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// TLS authentication params.
type MutualTls struct {
// WILL BE DEPRECATED, if set, will translates to `TLS_PERMISSIVE` mode.
// Set this flag to true to allow regular TLS (i.e without client x509
// certificate). If request carries client certificate, identity will be
// extracted and used (set to peer identity). Otherwise, peer identity will
// be left unset.
// When the flag is false (default), request must have client certificate.
AllowTls bool `protobuf:"varint,1,opt,name=allow_tls,json=allowTls,proto3" json:"allow_tls,omitempty"`
// Defines the mode of mTLS authentication.
Mode MutualTls_Mode `protobuf:"varint,2,opt,name=mode,proto3,enum=istio.authentication.v1alpha1.MutualTls_Mode" json:"mode,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MutualTls) Reset() { *m = MutualTls{} }
func (m *MutualTls) String() string { return proto.CompactTextString(m) }
func (*MutualTls) ProtoMessage() {}
func (*MutualTls) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{1}
}
func (m *MutualTls) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MutualTls.Unmarshal(m, b)
}
func (m *MutualTls) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MutualTls.Marshal(b, m, deterministic)
}
func (m *MutualTls) XXX_Merge(src proto.Message) {
xxx_messageInfo_MutualTls.Merge(m, src)
}
func (m *MutualTls) XXX_Size() int {
return xxx_messageInfo_MutualTls.Size(m)
}
func (m *MutualTls) XXX_DiscardUnknown() {
xxx_messageInfo_MutualTls.DiscardUnknown(m)
}
var xxx_messageInfo_MutualTls proto.InternalMessageInfo
func (m *MutualTls) GetAllowTls() bool {
if m != nil {
return m.AllowTls
}
return false
}
func (m *MutualTls) GetMode() MutualTls_Mode {
if m != nil {
return m.Mode
}
return MutualTls_STRICT
}
// JSON Web Token (JWT) token format for authentication as defined by
// https://tools.ietf.org/html/rfc7519. See [OAuth
// 2.0](https://tools.ietf.org/html/rfc6749) and [OIDC
// 1.0](http://openid.net/connect) for how this is used in the whole
// authentication flow.
//
// For example:
//
// A JWT for any requests:
//
// ```yaml
// issuer: https://example.com
// audiences:
// - bookstore_android.apps.googleusercontent.com
// bookstore_web.apps.googleusercontent.com
// jwksUri: https://example.com/.well-known/jwks.json
// ```
//
// A JWT for all requests except request at path `/health_check` and path with
// prefix `/status/`. This is useful to expose some paths for public access but
// keep others JWT validated.
//
// ```yaml
// issuer: https://example.com
// jwks_uri: https://example.com/.well-known/jwks.json
// trigger_rules:
// - excluded_paths:
// - exact: /health_check
// - prefix: /status/
// ```
//
// A JWT only for requests at path `/admin`. This is useful to only require JWT
// validation on a specific set of paths but keep others public accessible.
//
// ```yaml
// issuer: https://example.com
// jwks_uri: https://example.com/.well-known/jwks.json
// trigger_rules:
// - included_paths:
// - prefix: /admin
// ```
//
// A JWT only for requests at path of prefix `/status/` but except the path of
// `/status/version`. This means for any request path with prefix `/status/` except
// `/status/version` will require a valid JWT to proceed.
//
// ```yaml
// issuer: https://example.com
// jwks_uri: https://example.com/.well-known/jwks.json
// trigger_rules:
// - excluded_paths:
// - exact: /status/version
// included_paths:
// - prefix: /status/
// ```
type Jwt struct {
// Identifies the issuer that issued the JWT. See
// [issuer](https://tools.ietf.org/html/rfc7519#section-4.1.1)
// Usually a URL or an email address.
//
// Example: https://securetoken.google.com
// Example: 1234567-compute@developer.gserviceaccount.com
Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
// The list of JWT
// [audiences](https://tools.ietf.org/html/rfc7519#section-4.1.3).
// that are allowed to access. A JWT containing any of these
// audiences will be accepted.
//
// The service name will be accepted if audiences is empty.
//
// Example:
//
// ```yaml
// audiences:
// - bookstore_android.apps.googleusercontent.com
// bookstore_web.apps.googleusercontent.com
// ```
Audiences []string `protobuf:"bytes,2,rep,name=audiences,proto3" json:"audiences,omitempty"`
// URL of the provider's public key set to validate signature of the
// JWT. See [OpenID
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
//
// Optional if the key set document can either (a) be retrieved from
// [OpenID
// Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) of
// the issuer or (b) inferred from the email domain of the issuer (e.g. a
// Google service account).
//
// Example: https://www.googleapis.com/oauth2/v1/certs
JwksUri string `protobuf:"bytes,3,opt,name=jwks_uri,json=jwksUri,proto3" json:"jwks_uri,omitempty"`
// JWT is sent in a request header. `header` represents the
// header name.
//
// For example, if `header=x-goog-iap-jwt-assertion`, the header
// format will be x-goog-iap-jwt-assertion: <JWT>.
JwtHeaders []string `protobuf:"bytes,6,rep,name=jwt_headers,json=jwtHeaders,proto3" json:"jwt_headers,omitempty"`
// JWT is sent in a query parameter. `query` represents the
// query parameter name.
//
// For example, `query=jwt_token`.
JwtParams []string `protobuf:"bytes,7,rep,name=jwt_params,json=jwtParams,proto3" json:"jwt_params,omitempty"`
// List of trigger rules to decide if this JWT should be used to validate the
// request. The JWT validation happens if any one of the rules matched.
// If the list is not empty and none of the rules matched, authentication will
// skip the JWT validation.
// Leave this empty to always trigger the JWT validation.
TriggerRules []*Jwt_TriggerRule `protobuf:"bytes,9,rep,name=trigger_rules,json=triggerRules,proto3" json:"trigger_rules,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Jwt) Reset() { *m = Jwt{} }
func (m *Jwt) String() string { return proto.CompactTextString(m) }
func (*Jwt) ProtoMessage() {}
func (*Jwt) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{2}
}
func (m *Jwt) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Jwt.Unmarshal(m, b)
}
func (m *Jwt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Jwt.Marshal(b, m, deterministic)
}
func (m *Jwt) XXX_Merge(src proto.Message) {
xxx_messageInfo_Jwt.Merge(m, src)
}
func (m *Jwt) XXX_Size() int {
return xxx_messageInfo_Jwt.Size(m)
}
func (m *Jwt) XXX_DiscardUnknown() {
xxx_messageInfo_Jwt.DiscardUnknown(m)
}
var xxx_messageInfo_Jwt proto.InternalMessageInfo
func (m *Jwt) GetIssuer() string {
if m != nil {
return m.Issuer
}
return ""
}
func (m *Jwt) GetAudiences() []string {
if m != nil {
return m.Audiences
}
return nil
}
func (m *Jwt) GetJwksUri() string {
if m != nil {
return m.JwksUri
}
return ""
}
func (m *Jwt) GetJwtHeaders() []string {
if m != nil {
return m.JwtHeaders
}
return nil
}
func (m *Jwt) GetJwtParams() []string {
if m != nil {
return m.JwtParams
}
return nil
}
func (m *Jwt) GetTriggerRules() []*Jwt_TriggerRule {
if m != nil {
return m.TriggerRules
}
return nil
}
// Trigger rule to match against a request. The trigger rule is satisfied if
// and only if both rules, excluded_paths and include_paths are satisfied.
type Jwt_TriggerRule struct {
// List of paths to be excluded from the request. The rule is satisfied if
// request path does not match to any of the path in this list.
ExcludedPaths []*StringMatch `protobuf:"bytes,1,rep,name=excluded_paths,json=excludedPaths,proto3" json:"excluded_paths,omitempty"`
// List of paths that the request must include. If the list is not empty, the
// rule is satisfied if request path matches at least one of the path in the list.
// If the list is empty, the rule is ignored, in other words the rule is always satisfied.
IncludedPaths []*StringMatch `protobuf:"bytes,2,rep,name=included_paths,json=includedPaths,proto3" json:"included_paths,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Jwt_TriggerRule) Reset() { *m = Jwt_TriggerRule{} }
func (m *Jwt_TriggerRule) String() string { return proto.CompactTextString(m) }
func (*Jwt_TriggerRule) ProtoMessage() {}
func (*Jwt_TriggerRule) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{2, 0}
}
func (m *Jwt_TriggerRule) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Jwt_TriggerRule.Unmarshal(m, b)
}
func (m *Jwt_TriggerRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Jwt_TriggerRule.Marshal(b, m, deterministic)
}
func (m *Jwt_TriggerRule) XXX_Merge(src proto.Message) {
xxx_messageInfo_Jwt_TriggerRule.Merge(m, src)
}
func (m *Jwt_TriggerRule) XXX_Size() int {
return xxx_messageInfo_Jwt_TriggerRule.Size(m)
}
func (m *Jwt_TriggerRule) XXX_DiscardUnknown() {
xxx_messageInfo_Jwt_TriggerRule.DiscardUnknown(m)
}
var xxx_messageInfo_Jwt_TriggerRule proto.InternalMessageInfo
func (m *Jwt_TriggerRule) GetExcludedPaths() []*StringMatch {
if m != nil {
return m.ExcludedPaths
}
return nil
}
func (m *Jwt_TriggerRule) GetIncludedPaths() []*StringMatch {
if m != nil {
return m.IncludedPaths
}
return nil
}
// PeerAuthenticationMethod defines one particular type of authentication, e.g
// mutual TLS, JWT etc, (no authentication is one type by itself) that can
// be used for peer authentication.
// The type can be progammatically determine by checking the type of the
// "params" field.
type PeerAuthenticationMethod struct {
// Types that are valid to be assigned to Params:
// *PeerAuthenticationMethod_Mtls
// *PeerAuthenticationMethod_Jwt
Params isPeerAuthenticationMethod_Params `protobuf_oneof:"params"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PeerAuthenticationMethod) Reset() { *m = PeerAuthenticationMethod{} }
func (m *PeerAuthenticationMethod) String() string { return proto.CompactTextString(m) }
func (*PeerAuthenticationMethod) ProtoMessage() {}
func (*PeerAuthenticationMethod) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{3}
}
func (m *PeerAuthenticationMethod) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PeerAuthenticationMethod.Unmarshal(m, b)
}
func (m *PeerAuthenticationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PeerAuthenticationMethod.Marshal(b, m, deterministic)
}
func (m *PeerAuthenticationMethod) XXX_Merge(src proto.Message) {
xxx_messageInfo_PeerAuthenticationMethod.Merge(m, src)
}
func (m *PeerAuthenticationMethod) XXX_Size() int {
return xxx_messageInfo_PeerAuthenticationMethod.Size(m)
}
func (m *PeerAuthenticationMethod) XXX_DiscardUnknown() {
xxx_messageInfo_PeerAuthenticationMethod.DiscardUnknown(m)
}
var xxx_messageInfo_PeerAuthenticationMethod proto.InternalMessageInfo
type isPeerAuthenticationMethod_Params interface {
isPeerAuthenticationMethod_Params()
Equal(interface{}) bool
}
type PeerAuthenticationMethod_Mtls struct {
Mtls *MutualTls `protobuf:"bytes,1,opt,name=mtls,proto3,oneof"`
}
type PeerAuthenticationMethod_Jwt struct {
Jwt *Jwt `protobuf:"bytes,2,opt,name=jwt,proto3,oneof"`
}
func (*PeerAuthenticationMethod_Mtls) isPeerAuthenticationMethod_Params() {}
func (*PeerAuthenticationMethod_Jwt) isPeerAuthenticationMethod_Params() {}
func (m *PeerAuthenticationMethod) GetParams() isPeerAuthenticationMethod_Params {
if m != nil {
return m.Params
}
return nil
}
func (m *PeerAuthenticationMethod) GetMtls() *MutualTls {
if x, ok := m.GetParams().(*PeerAuthenticationMethod_Mtls); ok {
return x.Mtls
}
return nil
}
func (m *PeerAuthenticationMethod) GetJwt() *Jwt {
if x, ok := m.GetParams().(*PeerAuthenticationMethod_Jwt); ok {
return x.Jwt
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*PeerAuthenticationMethod) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _PeerAuthenticationMethod_OneofMarshaler, _PeerAuthenticationMethod_OneofUnmarshaler, _PeerAuthenticationMethod_OneofSizer, []interface{}{
(*PeerAuthenticationMethod_Mtls)(nil),
(*PeerAuthenticationMethod_Jwt)(nil),
}
}
func _PeerAuthenticationMethod_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*PeerAuthenticationMethod)
// params
switch x := m.Params.(type) {
case *PeerAuthenticationMethod_Mtls:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Mtls); err != nil {
return err
}
case *PeerAuthenticationMethod_Jwt:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Jwt); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("PeerAuthenticationMethod.Params has unexpected type %T", x)
}
return nil
}
func _PeerAuthenticationMethod_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*PeerAuthenticationMethod)
switch tag {
case 1: // params.mtls
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(MutualTls)
err := b.DecodeMessage(msg)
m.Params = &PeerAuthenticationMethod_Mtls{msg}
return true, err
case 2: // params.jwt
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(Jwt)
err := b.DecodeMessage(msg)
m.Params = &PeerAuthenticationMethod_Jwt{msg}
return true, err
default:
return false, nil
}
}
func _PeerAuthenticationMethod_OneofSizer(msg proto.Message) (n int) {
m := msg.(*PeerAuthenticationMethod)
// params
switch x := m.Params.(type) {
case *PeerAuthenticationMethod_Mtls:
s := proto.Size(x.Mtls)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *PeerAuthenticationMethod_Jwt:
s := proto.Size(x.Jwt)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// OriginAuthenticationMethod defines authentication method/params for origin
// authentication. Origin could be end-user, device, delegate service etc.
// Currently, only JWT is supported for origin authentication.
type OriginAuthenticationMethod struct {
// Jwt params for the method.
Jwt *Jwt `protobuf:"bytes,1,opt,name=jwt,proto3" json:"jwt,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *OriginAuthenticationMethod) Reset() { *m = OriginAuthenticationMethod{} }
func (m *OriginAuthenticationMethod) String() string { return proto.CompactTextString(m) }
func (*OriginAuthenticationMethod) ProtoMessage() {}
func (*OriginAuthenticationMethod) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{4}
}
func (m *OriginAuthenticationMethod) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OriginAuthenticationMethod.Unmarshal(m, b)
}
func (m *OriginAuthenticationMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_OriginAuthenticationMethod.Marshal(b, m, deterministic)
}
func (m *OriginAuthenticationMethod) XXX_Merge(src proto.Message) {
xxx_messageInfo_OriginAuthenticationMethod.Merge(m, src)
}
func (m *OriginAuthenticationMethod) XXX_Size() int {
return xxx_messageInfo_OriginAuthenticationMethod.Size(m)
}
func (m *OriginAuthenticationMethod) XXX_DiscardUnknown() {
xxx_messageInfo_OriginAuthenticationMethod.DiscardUnknown(m)
}
var xxx_messageInfo_OriginAuthenticationMethod proto.InternalMessageInfo
func (m *OriginAuthenticationMethod) GetJwt() *Jwt {
if m != nil {
return m.Jwt
}
return nil
}
// Policy defines what authentication methods can be accepted on workload(s),
// and if authenticated, which method/certificate will set the request principal
// (i.e request.auth.principal attribute).
//
// Authentication policy is composed of 2-part authentication:
// - peer: verify caller service credentials. This part will set source.user
// (peer identity).
// - origin: verify the origin credentials. This part will set request.auth.user
// (origin identity), as well as other attributes like request.auth.presenter,
// request.auth.audiences and raw claims. Note that the identity could be
// end-user, service account, device etc.
//
// Last but not least, the principal binding rule defines which identity (peer
// or origin) should be used as principal. By default, it uses peer.
//
// Examples:
//
// Policy to enable mTLS for all services in namespace frod
//
// ```yaml
// apiVersion: authentication.istio.io/v1alpha1
// kind: Policy
// metadata:
// name: mTLS_enable
// namespace: frod
// spec:
// peers:
// - mtls:
// ```
// Policy to disable mTLS for "productpage" service
//
// ```yaml
// apiVersion: authentication.istio.io/v1alpha1
// kind: Policy
// metadata:
// name: mTLS_disable
// namespace: frod
// spec:
// targets:
// - name: productpage
// ```
// Policy to require mTLS for peer authentication, and JWT for origin authentication
// for productpage:9000 except the path '/health_check' . Principal is set from origin identity.
//
// ```yaml
// apiVersion: authentication.istio.io/v1alpha1
// kind: Policy
// metadata:
// name: mTLS_enable
// namespace: frod
// spec:
// targets:
// - name: productpage
// ports:
// - number: 9000
// peers:
// - mtls:
// origins:
// - jwt:
// issuer: "https://securetoken.google.com"
// audiences:
// - "productpage"
// jwksUri: "https://www.googleapis.com/oauth2/v1/certs"
// jwt_headers:
// - "x-goog-iap-jwt-assertion"
// trigger_rules:
// - excluded_paths:
// - exact: /health_check
// principalBinding: USE_ORIGIN
// ```
type Policy struct {
// Status indicates the validation status of this resource.
// Status is read-only by clients, and set by supergloo during validation
Status core.Status `protobuf:"bytes,100,opt,name=status,proto3" json:"status" testdiff:"ignore"`
// Metadata contains the object metadata for this resource
Metadata core.Metadata `protobuf:"bytes,101,opt,name=metadata,proto3" json:"metadata"`
// List rules to select workloads that the policy should be applied on.
// If empty, policy will be used on all workloads in the same namespace.
Targets []*TargetSelector `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"`
// List of authentication methods that can be used for peer authentication.
// They will be evaluated in order; the first validate one will be used to
// set peer identity (source.user) and other peer attributes. If none of
// these methods pass, request will be rejected with authentication failed error (401).
// Leave the list empty if peer authentication is not required
Peers []*PeerAuthenticationMethod `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"`
// Set this flag to true to accept request (for peer authentication perspective),
// even when none of the peer authentication methods defined above satisfied.
// Typically, this is used to delay the rejection decision to next layer (e.g
// authorization).
// This flag is ignored if no authentication defined for peer (peers field is empty).
PeerIsOptional bool `protobuf:"varint,3,opt,name=peer_is_optional,json=peerIsOptional,proto3" json:"peer_is_optional,omitempty"`
// List of authentication methods that can be used for origin authentication.
// Similar to peers, these will be evaluated in order; the first validate one
// will be used to set origin identity and attributes (i.e request.auth.user,
// request.auth.issuer etc). If none of these methods pass, request will be
// rejected with authentication failed error (401).
// A method may be skipped, depends on its trigger rule. If all of these methods
// are skipped, origin authentication will be ignored, as if it is not defined.
// Leave the list empty if origin authentication is not required.
Origins []*OriginAuthenticationMethod `protobuf:"bytes,4,rep,name=origins,proto3" json:"origins,omitempty"`
// Set this flag to true to accept request (for origin authentication perspective),
// even when none of the origin authentication methods defined above satisfied.
// Typically, this is used to delay the rejection decision to next layer (e.g
// authorization).
// This flag is ignored if no authentication defined for origin (origins field is empty).
OriginIsOptional bool `protobuf:"varint,5,opt,name=origin_is_optional,json=originIsOptional,proto3" json:"origin_is_optional,omitempty"`
// Define whether peer or origin identity should be use for principal. Default
// value is USE_PEER.
// If peer (or origin) identity is not available, either because of peer/origin
// authentication is not defined, or failed, principal will be left unset.
// In other words, binding rule does not affect the decision to accept or
// reject request.
PrincipalBinding PrincipalBinding `protobuf:"varint,6,opt,name=principal_binding,json=principalBinding,proto3,enum=istio.authentication.v1alpha1.PrincipalBinding" json:"principal_binding,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Policy) Reset() { *m = Policy{} }
func (m *Policy) String() string { return proto.CompactTextString(m) }
func (*Policy) ProtoMessage() {}
func (*Policy) Descriptor() ([]byte, []int) {
return fileDescriptor_096bd9e17712cba3, []int{5}
}
func (m *Policy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Policy.Unmarshal(m, b)
}
func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Policy.Marshal(b, m, deterministic)
}
func (m *Policy) XXX_Merge(src proto.Message) {
xxx_messageInfo_Policy.Merge(m, src)
}
func (m *Policy) XXX_Size() int {
return xxx_messageInfo_Policy.Size(m)
}
func (m *Policy) XXX_DiscardUnknown() {
xxx_messageInfo_Policy.DiscardUnknown(m)
}
var xxx_messageInfo_Policy proto.InternalMessageInfo
func (m *Policy) GetStatus() core.Status {
if m != nil {
return m.Status
}
return core.Status{}
}
func (m *Policy) GetMetadata() core.Metadata {
if m != nil {
return m.Metadata
}
return core.Metadata{}
}
func (m *Policy) GetTargets() []*TargetSelector {
if m != nil {
return m.Targets
}
return nil
}
func (m *Policy) GetPeers() []*PeerAuthenticationMethod {
if m != nil {
return m.Peers
}
return nil
}
func (m *Policy) GetPeerIsOptional() bool {
if m != nil {
return m.PeerIsOptional
}
return false
}
func (m *Policy) GetOrigins() []*OriginAuthenticationMethod {
if m != nil {
return m.Origins
}
return nil
}
func (m *Policy) GetOriginIsOptional() bool {
if m != nil {
return m.OriginIsOptional
}
return false
}
func (m *Policy) GetPrincipalBinding() PrincipalBinding {
if m != nil {
return m.PrincipalBinding
}
return PrincipalBinding_USE_PEER
}
// MeshPolicy copied from Policy
type MeshPolicy struct {
// Status indicates the validation status of this resource.
// Status is read-only by clients, and set by supergloo during validation
Status core.Status `protobuf:"bytes,100,opt,name=status,proto3" json:"status" testdiff:"ignore"`
// Metadata contains the object metadata for this resource
Metadata core.Metadata `protobuf:"bytes,101,opt,name=metadata,proto3" json:"metadata"`
// List rules to select workloads that the policy should be applied on.
// If empty, policy will be used on all workloads in the same namespace.
Targets []*TargetSelector `protobuf:"bytes,1,rep,name=targets,proto3" json:"targets,omitempty"`
// List of authentication methods that can be used for peer authentication.
// They will be evaluated in order; the first validate one will be used to
// set peer identity (source.user) and other peer attributes. If none of
// these methods pass, request will be rejected with authentication failed error (401).
// Leave the list empty if peer authentication is not required
Peers []*PeerAuthenticationMethod `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"`
// Set this flag to true to accept request (for peer authentication perspective),
// even when none of the peer authentication methods defined above satisfied.
// Typically, this is used to delay the rejection decision to next layer (e.g
// authorization).
// This flag is ignored if no authentication defined for peer (peers field is empty).
PeerIsOptional bool `protobuf:"varint,3,opt,name=peer_is_optional,json=peerIsOptional,proto3" json:"peer_is_optional,omitempty"`
// List of authentication methods that can be used for origin authentication.
// Similar to peers, these will be evaluated in order; the first validate one
// will be used to set origin identity and attributes (i.e request.auth.user,
// request.auth.issuer etc). If none of these methods pass, request will be
// rejected with authentication failed error (401).
// A method may be skipped, depends on its trigger rule. If all of these methods
// are skipped, origin authentication will be ignored, as if it is not defined.
// Leave the list empty if origin authentication is not required.
Origins []*OriginAuthenticationMethod `protobuf:"bytes,4,rep,name=origins,proto3" json:"origins,omitempty"`
// Set this flag to true to accept request (for origin authentication perspective),
// even when none of the origin authentication methods defined above satisfied.
// Typically, this is used to delay the rejection decision to next layer (e.g
// authorization).
// This flag is ignored if no authentication defined for origin (origins field is empty).
OriginIsOptional bool `protobuf:"varint,5,opt,name=origin_is_optional,json=originIsOptional,proto3" json:"origin_is_optional,omitempty"`
// Define whether peer or origin identity should be use for principal. Default
// value is USE_PEER.
// If peer (or origin) identity is not available, either because of peer/origin
// authentication is not defined, or failed, principal will be left unset.
// In other words, binding rule does not affect the decision to accept or
// reject request.
PrincipalBinding PrincipalBinding `protobuf:"varint,6,opt,name=principal_binding,json=principalBinding,proto3,enum=istio.authentication.v1alpha1.PrincipalBinding" json:"principal_binding,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MeshPolicy) Reset() { *m = MeshPolicy{} }
func (m *MeshPolicy) String() string { return proto.CompactTextString(m) }