This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
client.pb.go
6928 lines (6716 loc) · 177 KB
/
client.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.
// source: client.proto
// DO NOT EDIT!
/*
Package proto is a generated protocol buffer package.
It is generated from these files:
client.proto
config.proto
duration.proto
keyserverconfig.proto
keyserverlocal.proto
replication.proto
timestamp.proto
tlsconfig.proto
verifier.proto
verifierconfig.proto
verifierlocal.proto
It has these top-level messages:
LookupRequest
UpdateRequest
LookupProof
TreeProof
Entry
SignedEntryUpdate
Profile
SignedEpochHead
TimestampedEpochHead
EpochHead
AuthorizationPolicy
PublicKey
QuorumExpr
EmailProof
Config
RealmConfig
Duration
ReplicaConfig
KeyserverConfig
RegistrationPolicy
EmailProofByDKIM
EmailProofByClientCert
EmailProofByOIDC
EmailProofBySAML
OIDCConfig
Replica
ReplicaState
KeyserverStep
EpochDelimiter
Timestamp
TLSConfig
CertificateAndKeyID
VerifierStreamRequest
VerifierStep
Nothing
VerifierConfig
VerifierState
*/
package proto
import proto1 "github.com/maditya/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/maditya/protobuf/gogoproto"
import bytes "bytes"
import strings "strings"
import github_com_maditya_protobuf_proto "github.com/maditya/protobuf/proto"
import sort "sort"
import strconv "strconv"
import reflect "reflect"
import github_com_maditya_protobuf_sortkeys "github.com/maditya/protobuf/sortkeys"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto1.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 _ = proto1.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type LookupRequest struct {
// Epoch as of which to perform the lookup ("latest" if not specified)
Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
// UserId will be mapped to an index by the server using VRF
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
// quorum_requirement specifies which verifiers must have ratified the
// result for it to be accepted. A server would fall back to an older
// directory state if the ratifications of the latest one do not satisfy
// the quorum requirement.
QuorumRequirement *QuorumExpr `protobuf:"bytes,4,opt,name=quorum_requirement,json=quorumRequirement" json:"quorum_requirement,omitempty"`
}
func (m *LookupRequest) Reset() { *m = LookupRequest{} }
func (*LookupRequest) ProtoMessage() {}
func (*LookupRequest) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{0} }
func (m *LookupRequest) GetQuorumRequirement() *QuorumExpr {
if m != nil {
return m.QuorumRequirement
}
return nil
}
// UpdateRequest specifies an update and the quorum required for
// considering the update successful. The server should respond with a lookup
// of the updated name with the specified parameters.
type UpdateRequest struct {
// Update is passed on to verifiers.
Update *SignedEntryUpdate `protobuf:"bytes,1,opt,name=update" json:"update,omitempty"`
// Profile is included in the update request from the client to the
// keyserver, but not passed on to the verifiers. The keyserver SHOULD
// store it locally and include it in LookupProofs returned for lookups.
// The verifiers MUST NOT try to read this field.
// A keyserver MUST NOT discriminate users based on ther structure of their
// profile other than enforcing a common-sense size limit. In particular, a
// profile with fields that the keyserver does not understand or whose
// values it considers invalid MUST be accepted.
Profile EncodedProfile `protobuf:"bytes,2,opt,name=profile,customtype=EncodedProfile" json:"profile"`
LookupParameters *LookupRequest `protobuf:"bytes,3,opt,name=lookup_parameters,json=lookupParameters" json:"lookup_parameters,omitempty"`
EmailProof *EmailProof `protobuf:"bytes,1000,opt,name=email_proof,json=emailProof" json:"email_proof,omitempty"`
}
func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
func (*UpdateRequest) ProtoMessage() {}
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{1} }
func (m *UpdateRequest) GetUpdate() *SignedEntryUpdate {
if m != nil {
return m.Update
}
return nil
}
func (m *UpdateRequest) GetLookupParameters() *LookupRequest {
if m != nil {
return m.LookupParameters
}
return nil
}
func (m *UpdateRequest) GetEmailProof() *EmailProof {
if m != nil {
return m.EmailProof
}
return nil
}
// LookupProof encapsulates end-to-end cryptographc evidence that assuming *at
// least one* of the ratifiers has been correctly following the rules of the
// keyserver protocol then profile contains the latest public keys and metadata
// uploaded by user_id before the time specified in ratifications[0]. If any
// step of the proof does not check out, the contents of profile MUST NOT be
// used for any other purpose than debugging.
type LookupProof struct {
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Index []byte `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"`
// index_proof proves that index is a result of applying a globally fixed
// bijection VRF to user_id: idx = VRF(user_ID). If this proof checks out,
// we can safely continue by looking up the keyserver entry corresponding
// to index to get the public key of user_id.
IndexProof []byte `protobuf:"bytes,3,opt,name=index_proof,json=indexProof,proto3" json:"index_proof,omitempty"`
// ratifications contains signed directory state summaries for the epoch under
// which the lookup was performed.
// A single valid ratification r by a honest and correct verifier implies
// that the r.ratification.summary.root_hash summarizes the authenticated
// data structure containing the unique and correct mapping from indices to
// entries as of epoch r.ratification.epoch at human time
// r.ratification.timestamp.
// Each ratification must contain the same epoch head. A client MUST ignore a
// proof if the ratifications do not satisfy its quorum requirement and MUST
// require the keyserver itself to be in the quorum.
Ratifications []*SignedEpochHead `protobuf:"bytes,4,rep,name=ratifications" json:"ratifications,omitempty"`
// tree_proof contains an authenticated data structure lookup trace,
// arguing that index maps to entry in the data structure with hash
// ratifications[0].ratification.summary.root_hash.
TreeProof *TreeProof `protobuf:"bytes,5,opt,name=tree_proof,json=treeProof" json:"tree_proof,omitempty"`
// Entry specifies profile by hash(profile) = entry.profile_hash
Entry *EncodedEntry `protobuf:"bytes,6,opt,name=entry,customtype=EncodedEntry" json:"entry,omitempty"`
Profile *EncodedProfile `protobuf:"bytes,7,opt,name=profile,customtype=EncodedProfile" json:"profile,omitempty"`
}
func (m *LookupProof) Reset() { *m = LookupProof{} }
func (*LookupProof) ProtoMessage() {}
func (*LookupProof) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{2} }
func (m *LookupProof) GetRatifications() []*SignedEpochHead {
if m != nil {
return m.Ratifications
}
return nil
}
func (m *LookupProof) GetTreeProof() *TreeProof {
if m != nil {
return m.TreeProof
}
return nil
}
// A Proof provides an authentication path through the Merkle Tree that
// proves that an item is or is not present in the tree.
type TreeProof struct {
// Neighbors is a list of all the adjacent nodes along the path from the
// bottommost node to the root. To save space, hashes for empty subtrees are
// nil, and the number of hashes is equal to the length of the longest common
// prefix with another entry in the tree (since a leaf node is moved up to
// that point -- subtrees with a single entry are coalesced into a single
// node).
Neighbors [][]byte `protobuf:"bytes,1,rep,name=neighbors" json:"neighbors,omitempty"`
// This is the index for the binding that does exist; it will share a prefix
// with the requested index, but in case the leaf contains the wrong
// contents, it will be different. It will be nil if the requested VRF falls
// under an empty branch.
ExistingIndex []byte `protobuf:"bytes,2,opt,name=existing_index,json=existingIndex,proto3" json:"existing_index,omitempty"`
// This is the hash of the entry for the binding that does exist. If the leaf
// contains the wrong contents, the client can use this to verify that the
// incorrect leaf takes up the entire branch.
ExistingEntryHash []byte `protobuf:"bytes,3,opt,name=existing_entry_hash,json=existingEntryHash,proto3" json:"existing_entry_hash,omitempty"`
}
func (m *TreeProof) Reset() { *m = TreeProof{} }
func (*TreeProof) ProtoMessage() {}
func (*TreeProof) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{3} }
// Entry is the value type in the authenticated mapping data structure. The
// contents of all entries should be considered public (they are served to
// verifiers).
type Entry struct {
// Index specifies the location of the entry in the authenticated
// mapping data structure. It is computed as a verifiable random
// function of the name: the keyserver can prove that index=vrf(name)
// to anybody, but nobody else can compute vrf(name1). This is to
// maintain the privacy of usernames.
Index []byte `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
// Version starts at 0 at registration and must not decrease. The keyserver
// and verifiers MUST reject SignedEntryUpdates which violate these rules.
// The purpose of this is to prevent an attacker from replaying a
// SignedEntryUpdate that publishes a key that the attacker has gained
// control of. On the other hand, increases by more than one are allowed: a
// user should be allowed to generate a long-lived offline revocation
// certificate that is valid even after they make some other change to
// their profile. Nevertheless, unless explicitly required otherwise,
// clients should increase the version number by exactly one on each
// update.
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
// UpdatePolicy will be used to verify SignedEntryUpdates to this
// entry. It is NOT used for encryption, and SHOULD be ignored by
// applications that do not intend to manage the user's profile. It has
// also been called "the public key of the profile signing key" or "the
// public identity key". A keyserver MUST NOT discriminate users based on
// ther structure of their update_key other than (1) as specified in
// SignedEntryUpdate and (2) common-sense limits on the total size of an
// entry to limit storage cost.
UpdatePolicy *AuthorizationPolicy `protobuf:"bytes,3,opt,name=update_policy,json=updatePolicy" json:"update_policy,omitempty"`
// ProfileCommitment uniquely specifies the profile without revealing its
// contents. The commitment is computed as commitment =
// sha3shake256(profile); the contents contain a nonce.
ProfileCommitment []byte `protobuf:"bytes,4,opt,name=profile_commitment,json=profileCommitment,proto3" json:"profile_commitment,omitempty"`
}
func (m *Entry) Reset() { *m = Entry{} }
func (*Entry) ProtoMessage() {}
func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{4} }
func (m *Entry) GetUpdatePolicy() *AuthorizationPolicy {
if m != nil {
return m.UpdatePolicy
}
return nil
}
// SignedEntryUpdate is the minimal self-contained structure to justify
// changing the value of an entry. In the state machine model of a namespace,
// SignedEntryUpdate is the main input type.
type SignedEntryUpdate struct {
NewEntry EncodedEntry `protobuf:"bytes,1,opt,name=new_entry,json=newEntry,customtype=EncodedEntry" json:"new_entry"`
// NewSig, if successfully verified using update.new_entry.update_key,
// confirms that the new entry is willing to be bound to this index.
// Both the keyserver and verifiers MUST check these signatures against the
// old profile's authorization policy AND the new profile's authorization
// policy. All signatures are tagged with ID of the public key that
// generated them.
Signatures map[uint64][]byte `protobuf:"bytes,2,rep,name=signatures" json:"signatures,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *SignedEntryUpdate) Reset() { *m = SignedEntryUpdate{} }
func (*SignedEntryUpdate) ProtoMessage() {}
func (*SignedEntryUpdate) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{5} }
func (m *SignedEntryUpdate) GetSignatures() map[uint64][]byte {
if m != nil {
return m.Signatures
}
return nil
}
// A user's profile, containing public keys and other information.
// A new field will be added here for each application, with the TCP/UDP port
// number as field number whenever possible to avoid collisions.
type Profile struct {
// Nonce containst at least 16 bytes (and counts towards the total profile
// size limit). Having a nonce in each profile ensures that an attacker
// can't guess-and-check somebody's profile contents using Entry.profile_hash.
// It is the client's responsibility to generate a random nonce to protect the
// privacy of its profile, thus the presence of this field is not checked by
// the server.
Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
// Application-specific public keys. The map is keyed by application ID.
Keys map[string][]byte `protobuf:"bytes,2,rep,name=keys" json:"keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *Profile) Reset() { *m = Profile{} }
func (*Profile) ProtoMessage() {}
func (*Profile) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{6} }
func (m *Profile) GetKeys() map[string][]byte {
if m != nil {
return m.Keys
}
return nil
}
// SignedEpochHead messages are used by auditors and the service provider to
// vouch that the SummaryHash represents the correct unique global state at the
// end of epoch. In particular, it means that the signer has enforced the
// profile update policy specified in the doc-comments of SignedEntryUpdate and
// Profile for the specified epoch AND all prior epochs. A Ratification MUST
// NOT be signed in any other circumstances.
type SignedEpochHead struct {
Head EncodedTimestampedEpochHead `protobuf:"bytes,1,opt,name=head,customtype=EncodedTimestampedEpochHead" json:"head"`
// Signatures is used for authentication of ratification and MUST be
// verified before interpreting any contents of ratification.
// All signatures are tagged with ID of the public key that generated them.
Signatures map[uint64][]byte `protobuf:"bytes,2,rep,name=signatures" json:"signatures,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *SignedEpochHead) Reset() { *m = SignedEpochHead{} }
func (*SignedEpochHead) ProtoMessage() {}
func (*SignedEpochHead) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{7} }
func (m *SignedEpochHead) GetSignatures() map[uint64][]byte {
if m != nil {
return m.Signatures
}
return nil
}
type TimestampedEpochHead struct {
// EpochHead specifies the entire state and history of the
// realm.
Head EncodedEpochHead `protobuf:"bytes,1,opt,name=head,customtype=EncodedEpochHead" json:"head"`
// Timestamp specifies when the requirements for SignedEpochHead
// were checked. Clients will accept a SignedEpochHead timestamped at most a
// fixed amount of time into the past, and MUST fail secure if the timestamp
// is not fresh because the directory state may have changed. The signature
// expiration tolerance plus the maximum clock skew between a pair of clients
// is the maximum propogation time of a change from one to another after which
// even a malicious keyserver will not be able to convince a client to a
// accept the previous state (assuming that all quorums the client considers
// sufficient contain a correct and honest server).
Timestamp Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp"`
}
func (m *TimestampedEpochHead) Reset() { *m = TimestampedEpochHead{} }
func (*TimestampedEpochHead) ProtoMessage() {}
func (*TimestampedEpochHead) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{8} }
func (m *TimestampedEpochHead) GetTimestamp() Timestamp {
if m != nil {
return m.Timestamp
}
return Timestamp{}
}
type EpochHead struct {
// Realm is the fully-qualified domain name of the keyserver whose
// state is being ratified.
Realm string `protobuf:"bytes,1,opt,name=realm,proto3" json:"realm,omitempty"`
// Epoch is a sequence number tracking distinct ratified states.
Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"`
// RootHash specifies the authenticated data structure.
RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"`
// IssueTime is the time when this epoch was released. All epochs for the
// same keyserver MUST have non-decreasing IssueTimes.
IssueTime Timestamp `protobuf:"bytes,4,opt,name=issue_time,json=issueTime" json:"issue_time"`
// PreviousSummaryHash chaining is used to allow signatures from
// different epochs in the same quorum: a signature vouches for all
// epochs chained to that in addition to the one listed.
// Each PreviousSummaryHash depends on PreviousSummary, therefore
// (by induction on the hash-pointer structure) a
// PreviousSummeryHash for some epoch specifies the states of all
// previous epochs. This hash uses SHA3-SHAKE256 with 64 bytes of output.
PreviousSummaryHash []byte `protobuf:"bytes,5,opt,name=previous_summary_hash,json=previousSummaryHash,proto3" json:"previous_summary_hash,omitempty"`
// NextEpochPolicy allows for automated server key rollover: the new key(s)
// are signed by the current one as a part of the epoch. This field is nil
// if no key change is requested. If the server key is distributed with the
// client software and benefits from reliable automated updates, clients
// MAY ignore this field.
NextEpochPolicy AuthorizationPolicy `protobuf:"bytes,6,opt,name=next_epoch_policy,json=nextEpochPolicy" json:"next_epoch_policy"`
}
func (m *EpochHead) Reset() { *m = EpochHead{} }
func (*EpochHead) ProtoMessage() {}
func (*EpochHead) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{9} }
func (m *EpochHead) GetIssueTime() Timestamp {
if m != nil {
return m.IssueTime
}
return Timestamp{}
}
func (m *EpochHead) GetNextEpochPolicy() AuthorizationPolicy {
if m != nil {
return m.NextEpochPolicy
}
return AuthorizationPolicy{}
}
// AuthorizationPolicy is used to check whether some signatures make up
// sufficient authorization to back an action.
// This is used to implement the following:
// 1. Account Recovery through service provider: if an user's entry has the
// update key set to threshold(1,user,serviceprovider), the service
// provider can perform account recovery. Note that a third party will not
// necessarily know who the subkeys are held by. Thus, the client
// implementation MUST require a signed certificate confirming possession
// of the secret key and promising to do no evil from every trustee whose
// key is used for recovery in this manner.
// 2. Service providers with servers in geographically diverse locations
// can use a threshold to limit the damage the compromise or loss of one
// replica can do. Example threshold(2,freedonia,gilead,mordor).
// 3. Adaptive key rollover during cryptocalypse.
type AuthorizationPolicy struct {
PublicKeys map[uint64]*PublicKey `protobuf:"bytes,1,rep,name=public_keys,json=publicKeys" json:"public_keys,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
// Types that are valid to be assigned to PolicyType:
// *AuthorizationPolicy_Quorum
PolicyType isAuthorizationPolicy_PolicyType `protobuf_oneof:"policy_type"`
}
func (m *AuthorizationPolicy) Reset() { *m = AuthorizationPolicy{} }
func (*AuthorizationPolicy) ProtoMessage() {}
func (*AuthorizationPolicy) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{10} }
type isAuthorizationPolicy_PolicyType interface {
isAuthorizationPolicy_PolicyType()
Equal(interface{}) bool
VerboseEqual(interface{}) error
MarshalTo([]byte) (int, error)
Size() int
}
type AuthorizationPolicy_Quorum struct {
Quorum *QuorumExpr `protobuf:"bytes,2,opt,name=quorum,oneof"`
}
func (*AuthorizationPolicy_Quorum) isAuthorizationPolicy_PolicyType() {}
func (m *AuthorizationPolicy) GetPolicyType() isAuthorizationPolicy_PolicyType {
if m != nil {
return m.PolicyType
}
return nil
}
func (m *AuthorizationPolicy) GetPublicKeys() map[uint64]*PublicKey {
if m != nil {
return m.PublicKeys
}
return nil
}
func (m *AuthorizationPolicy) GetQuorum() *QuorumExpr {
if x, ok := m.GetPolicyType().(*AuthorizationPolicy_Quorum); ok {
return x.Quorum
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*AuthorizationPolicy) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {
return _AuthorizationPolicy_OneofMarshaler, _AuthorizationPolicy_OneofUnmarshaler, _AuthorizationPolicy_OneofSizer, []interface{}{
(*AuthorizationPolicy_Quorum)(nil),
}
}
func _AuthorizationPolicy_OneofMarshaler(msg proto1.Message, b *proto1.Buffer) error {
m := msg.(*AuthorizationPolicy)
// policy_type
switch x := m.PolicyType.(type) {
case *AuthorizationPolicy_Quorum:
_ = b.EncodeVarint(2<<3 | proto1.WireBytes)
if err := b.EncodeMessage(x.Quorum); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("AuthorizationPolicy.PolicyType has unexpected type %T", x)
}
return nil
}
func _AuthorizationPolicy_OneofUnmarshaler(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error) {
m := msg.(*AuthorizationPolicy)
switch tag {
case 2: // policy_type.quorum
if wire != proto1.WireBytes {
return true, proto1.ErrInternalBadWireType
}
msg := new(QuorumExpr)
err := b.DecodeMessage(msg)
m.PolicyType = &AuthorizationPolicy_Quorum{msg}
return true, err
default:
return false, nil
}
}
func _AuthorizationPolicy_OneofSizer(msg proto1.Message) (n int) {
m := msg.(*AuthorizationPolicy)
// policy_type
switch x := m.PolicyType.(type) {
case *AuthorizationPolicy_Quorum:
s := proto1.Size(x.Quorum)
n += proto1.SizeVarint(2<<3 | proto1.WireBytes)
n += proto1.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// PublicKey wraps a public key of a cryptographically secure signature
// scheme and verification metadata. Each verifier can have its own signature
// format and needs to implement serialization and deserialization of its own
// signatures. The ID of a public key is defined as the 64-bit SHAKE256 hash of
// the protobuf-encoded public key (and interpreted as little-endian when a
// numeric representation is required).
type PublicKey struct {
// Types that are valid to be assigned to PubkeyType:
// *PublicKey_Ed25519
PubkeyType isPublicKey_PubkeyType `protobuf_oneof:"pubkey_type"`
}
func (m *PublicKey) Reset() { *m = PublicKey{} }
func (*PublicKey) ProtoMessage() {}
func (*PublicKey) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{11} }
type isPublicKey_PubkeyType interface {
isPublicKey_PubkeyType()
Equal(interface{}) bool
VerboseEqual(interface{}) error
MarshalTo([]byte) (int, error)
Size() int
}
type PublicKey_Ed25519 struct {
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof"`
}
func (*PublicKey_Ed25519) isPublicKey_PubkeyType() {}
func (m *PublicKey) GetPubkeyType() isPublicKey_PubkeyType {
if m != nil {
return m.PubkeyType
}
return nil
}
func (m *PublicKey) GetEd25519() []byte {
if x, ok := m.GetPubkeyType().(*PublicKey_Ed25519); ok {
return x.Ed25519
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*PublicKey) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {
return _PublicKey_OneofMarshaler, _PublicKey_OneofUnmarshaler, _PublicKey_OneofSizer, []interface{}{
(*PublicKey_Ed25519)(nil),
}
}
func _PublicKey_OneofMarshaler(msg proto1.Message, b *proto1.Buffer) error {
m := msg.(*PublicKey)
// pubkey_type
switch x := m.PubkeyType.(type) {
case *PublicKey_Ed25519:
_ = b.EncodeVarint(1<<3 | proto1.WireBytes)
_ = b.EncodeRawBytes(x.Ed25519)
case nil:
default:
return fmt.Errorf("PublicKey.PubkeyType has unexpected type %T", x)
}
return nil
}
func _PublicKey_OneofUnmarshaler(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error) {
m := msg.(*PublicKey)
switch tag {
case 1: // pubkey_type.ed25519
if wire != proto1.WireBytes {
return true, proto1.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.PubkeyType = &PublicKey_Ed25519{x}
return true, err
default:
return false, nil
}
}
func _PublicKey_OneofSizer(msg proto1.Message) (n int) {
m := msg.(*PublicKey)
// pubkey_type
switch x := m.PubkeyType.(type) {
case *PublicKey_Ed25519:
n += proto1.SizeVarint(1<<3 | proto1.WireBytes)
n += proto1.SizeVarint(uint64(len(x.Ed25519)))
n += len(x.Ed25519)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// QuorumExpr represents a function with type set<uint64> -> bool. An
// expression evaluates to true given args iff the sum of the following two
// numbers is at least threshold:
// - number of entries in verifiers that are in args
// - number of subexpressions that evaluate to true
// note: expr.eval(a) \wedge expr.eval(b) -> expr.eval(a \cup b)
type QuorumExpr struct {
Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"`
Candidates []uint64 `protobuf:"fixed64,2,rep,packed,name=candidates" json:"candidates,omitempty"`
// QuorumExpr allows expressing contitions of the form "two out of these
// and three out of those".
// If an implementation chooses to ban recursive thresholding, it can do so
// ignoring this field. However, doing so is NOT SUPPORTED.
Subexpressions []*QuorumExpr `protobuf:"bytes,3,rep,name=subexpressions" json:"subexpressions,omitempty"`
}
func (m *QuorumExpr) Reset() { *m = QuorumExpr{} }
func (*QuorumExpr) ProtoMessage() {}
func (*QuorumExpr) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{12} }
func (m *QuorumExpr) GetSubexpressions() []*QuorumExpr {
if m != nil {
return m.Subexpressions
}
return nil
}
// EmailProof provides a proof of ownership of the email address
type EmailProof struct {
// Types that are valid to be assigned to ProofType:
// *EmailProof_DKIMProof
// *EmailProof_OIDCToken
// *EmailProof_SAMLResponse
ProofType isEmailProof_ProofType `protobuf_oneof:"proof_type"`
}
func (m *EmailProof) Reset() { *m = EmailProof{} }
func (*EmailProof) ProtoMessage() {}
func (*EmailProof) Descriptor() ([]byte, []int) { return fileDescriptorClient, []int{13} }
type isEmailProof_ProofType interface {
isEmailProof_ProofType()
Equal(interface{}) bool
VerboseEqual(interface{}) error
MarshalTo([]byte) (int, error)
Size() int
}
type EmailProof_DKIMProof struct {
DKIMProof []byte `protobuf:"bytes,1,opt,name=dkim_proof,json=dkimProof,proto3,oneof"`
}
type EmailProof_OIDCToken struct {
OIDCToken string `protobuf:"bytes,2,opt,name=oidc_token,json=oidcToken,proto3,oneof"`
}
type EmailProof_SAMLResponse struct {
SAMLResponse string `protobuf:"bytes,3,opt,name=saml_response,json=samlResponse,proto3,oneof"`
}
func (*EmailProof_DKIMProof) isEmailProof_ProofType() {}
func (*EmailProof_OIDCToken) isEmailProof_ProofType() {}
func (*EmailProof_SAMLResponse) isEmailProof_ProofType() {}
func (m *EmailProof) GetProofType() isEmailProof_ProofType {
if m != nil {
return m.ProofType
}
return nil
}
func (m *EmailProof) GetDKIMProof() []byte {
if x, ok := m.GetProofType().(*EmailProof_DKIMProof); ok {
return x.DKIMProof
}
return nil
}
func (m *EmailProof) GetOIDCToken() string {
if x, ok := m.GetProofType().(*EmailProof_OIDCToken); ok {
return x.OIDCToken
}
return ""
}
func (m *EmailProof) GetSAMLResponse() string {
if x, ok := m.GetProofType().(*EmailProof_SAMLResponse); ok {
return x.SAMLResponse
}
return ""
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*EmailProof) XXX_OneofFuncs() (func(msg proto1.Message, b *proto1.Buffer) error, func(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error), func(msg proto1.Message) (n int), []interface{}) {
return _EmailProof_OneofMarshaler, _EmailProof_OneofUnmarshaler, _EmailProof_OneofSizer, []interface{}{
(*EmailProof_DKIMProof)(nil),
(*EmailProof_OIDCToken)(nil),
(*EmailProof_SAMLResponse)(nil),
}
}
func _EmailProof_OneofMarshaler(msg proto1.Message, b *proto1.Buffer) error {
m := msg.(*EmailProof)
// proof_type
switch x := m.ProofType.(type) {
case *EmailProof_DKIMProof:
_ = b.EncodeVarint(1<<3 | proto1.WireBytes)
_ = b.EncodeRawBytes(x.DKIMProof)
case *EmailProof_OIDCToken:
_ = b.EncodeVarint(2<<3 | proto1.WireBytes)
_ = b.EncodeStringBytes(x.OIDCToken)
case *EmailProof_SAMLResponse:
_ = b.EncodeVarint(3<<3 | proto1.WireBytes)
_ = b.EncodeStringBytes(x.SAMLResponse)
case nil:
default:
return fmt.Errorf("EmailProof.ProofType has unexpected type %T", x)
}
return nil
}
func _EmailProof_OneofUnmarshaler(msg proto1.Message, tag, wire int, b *proto1.Buffer) (bool, error) {
m := msg.(*EmailProof)
switch tag {
case 1: // proof_type.dkim_proof
if wire != proto1.WireBytes {
return true, proto1.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.ProofType = &EmailProof_DKIMProof{x}
return true, err
case 2: // proof_type.oidc_token
if wire != proto1.WireBytes {
return true, proto1.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.ProofType = &EmailProof_OIDCToken{x}
return true, err
case 3: // proof_type.saml_response
if wire != proto1.WireBytes {
return true, proto1.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.ProofType = &EmailProof_SAMLResponse{x}
return true, err
default:
return false, nil
}
}
func _EmailProof_OneofSizer(msg proto1.Message) (n int) {
m := msg.(*EmailProof)
// proof_type
switch x := m.ProofType.(type) {
case *EmailProof_DKIMProof:
n += proto1.SizeVarint(1<<3 | proto1.WireBytes)
n += proto1.SizeVarint(uint64(len(x.DKIMProof)))
n += len(x.DKIMProof)
case *EmailProof_OIDCToken:
n += proto1.SizeVarint(2<<3 | proto1.WireBytes)
n += proto1.SizeVarint(uint64(len(x.OIDCToken)))
n += len(x.OIDCToken)
case *EmailProof_SAMLResponse:
n += proto1.SizeVarint(3<<3 | proto1.WireBytes)
n += proto1.SizeVarint(uint64(len(x.SAMLResponse)))
n += len(x.SAMLResponse)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
func init() {
proto1.RegisterType((*LookupRequest)(nil), "proto.LookupRequest")
proto1.RegisterType((*UpdateRequest)(nil), "proto.UpdateRequest")
proto1.RegisterType((*LookupProof)(nil), "proto.LookupProof")
proto1.RegisterType((*TreeProof)(nil), "proto.TreeProof")
proto1.RegisterType((*Entry)(nil), "proto.Entry")
proto1.RegisterType((*SignedEntryUpdate)(nil), "proto.SignedEntryUpdate")
proto1.RegisterType((*Profile)(nil), "proto.Profile")
proto1.RegisterType((*SignedEpochHead)(nil), "proto.SignedEpochHead")
proto1.RegisterType((*TimestampedEpochHead)(nil), "proto.TimestampedEpochHead")
proto1.RegisterType((*EpochHead)(nil), "proto.EpochHead")
proto1.RegisterType((*AuthorizationPolicy)(nil), "proto.AuthorizationPolicy")
proto1.RegisterType((*PublicKey)(nil), "proto.PublicKey")
proto1.RegisterType((*QuorumExpr)(nil), "proto.QuorumExpr")
proto1.RegisterType((*EmailProof)(nil), "proto.EmailProof")
}
func (this *LookupRequest) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*LookupRequest)
if !ok {
that2, ok := that.(LookupRequest)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *LookupRequest")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *LookupRequest but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *LookupRequest but is not nil && this == nil")
}
if this.Epoch != that1.Epoch {
return fmt.Errorf("Epoch this(%v) Not Equal that(%v)", this.Epoch, that1.Epoch)
}
if this.UserId != that1.UserId {
return fmt.Errorf("UserId this(%v) Not Equal that(%v)", this.UserId, that1.UserId)
}
if !this.QuorumRequirement.Equal(that1.QuorumRequirement) {
return fmt.Errorf("QuorumRequirement this(%v) Not Equal that(%v)", this.QuorumRequirement, that1.QuorumRequirement)
}
return nil
}
func (this *LookupRequest) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*LookupRequest)
if !ok {
that2, ok := that.(LookupRequest)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Epoch != that1.Epoch {
return false
}
if this.UserId != that1.UserId {
return false
}
if !this.QuorumRequirement.Equal(that1.QuorumRequirement) {
return false
}
return true
}
func (this *UpdateRequest) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*UpdateRequest)
if !ok {
that2, ok := that.(UpdateRequest)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *UpdateRequest")
}
}
if that1 == nil {
if this == nil {
return nil
}
return fmt.Errorf("that is type *UpdateRequest but is nil && this != nil")
} else if this == nil {
return fmt.Errorf("that is type *UpdateRequest but is not nil && this == nil")
}
if !this.Update.Equal(that1.Update) {
return fmt.Errorf("Update this(%v) Not Equal that(%v)", this.Update, that1.Update)
}
if !this.Profile.Equal(that1.Profile) {
return fmt.Errorf("Profile this(%v) Not Equal that(%v)", this.Profile, that1.Profile)
}
if !this.LookupParameters.Equal(that1.LookupParameters) {
return fmt.Errorf("LookupParameters this(%v) Not Equal that(%v)", this.LookupParameters, that1.LookupParameters)
}
if !this.EmailProof.Equal(that1.EmailProof) {
return fmt.Errorf("EmailProof this(%v) Not Equal that(%v)", this.EmailProof, that1.EmailProof)
}
return nil
}
func (this *UpdateRequest) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*UpdateRequest)
if !ok {
that2, ok := that.(UpdateRequest)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if !this.Update.Equal(that1.Update) {
return false
}
if !this.Profile.Equal(that1.Profile) {
return false
}
if !this.LookupParameters.Equal(that1.LookupParameters) {
return false
}
if !this.EmailProof.Equal(that1.EmailProof) {
return false
}
return true
}
func (this *LookupProof) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt.Errorf("that == nil && this != nil")
}
that1, ok := that.(*LookupProof)
if !ok {
that2, ok := that.(LookupProof)
if ok {
that1 = &that2
} else {
return fmt.Errorf("that is not of type *LookupProof")
}
}
if that1 == nil {
if this == nil {
return nil
}