-
Notifications
You must be signed in to change notification settings - Fork 180
/
cells-auth_grpc.enhanced.pb.go
674 lines (628 loc) · 24.1 KB
/
cells-auth_grpc.enhanced.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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.1.0
// - protoc v3.18.1
// source: cells-auth.proto
package auth
import (
context "context"
fmt "fmt"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
metadata "google.golang.org/grpc/metadata"
status "google.golang.org/grpc/status"
sync "sync"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
var (
enhancedAuthTokenRevokerServers = make(map[string]AuthTokenRevokerEnhancedServer)
enhancedAuthTokenRevokerServersLock = sync.RWMutex{}
)
type NamedAuthTokenRevokerServer interface {
AuthTokenRevokerServer
Name() string
}
type AuthTokenRevokerEnhancedServer map[string]NamedAuthTokenRevokerServer
// Revoker invalidates the current token and specifies if the invalidation is due to a refresh or a revokation
func (m AuthTokenRevokerEnhancedServer) Revoke(ctx context.Context, r *RevokeTokenRequest) (*RevokeTokenResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Revoke should have a context")
}
enhancedAuthTokenRevokerServersLock.RLock()
defer enhancedAuthTokenRevokerServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Revoke(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
}
func (m AuthTokenRevokerEnhancedServer) mustEmbedUnimplementedAuthTokenRevokerServer() {}
func RegisterAuthTokenRevokerEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthTokenRevokerServer) {
enhancedAuthTokenRevokerServersLock.Lock()
defer enhancedAuthTokenRevokerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenRevokerServers[addr]
if !ok {
m = AuthTokenRevokerEnhancedServer{}
enhancedAuthTokenRevokerServers[addr] = m
RegisterAuthTokenRevokerServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthTokenRevokerEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthTokenRevokerServersLock.Lock()
defer enhancedAuthTokenRevokerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenRevokerServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedAuthTokenPrunerServers = make(map[string]AuthTokenPrunerEnhancedServer)
enhancedAuthTokenPrunerServersLock = sync.RWMutex{}
)
type NamedAuthTokenPrunerServer interface {
AuthTokenPrunerServer
Name() string
}
type AuthTokenPrunerEnhancedServer map[string]NamedAuthTokenPrunerServer
// PruneTokens clear revoked tokens
func (m AuthTokenPrunerEnhancedServer) PruneTokens(ctx context.Context, r *PruneTokensRequest) (*PruneTokensResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method PruneTokens should have a context")
}
enhancedAuthTokenPrunerServersLock.RLock()
defer enhancedAuthTokenPrunerServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.PruneTokens(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method PruneTokens not implemented")
}
func (m AuthTokenPrunerEnhancedServer) mustEmbedUnimplementedAuthTokenPrunerServer() {}
func RegisterAuthTokenPrunerEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthTokenPrunerServer) {
enhancedAuthTokenPrunerServersLock.Lock()
defer enhancedAuthTokenPrunerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenPrunerServers[addr]
if !ok {
m = AuthTokenPrunerEnhancedServer{}
enhancedAuthTokenPrunerServers[addr] = m
RegisterAuthTokenPrunerServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthTokenPrunerEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthTokenPrunerServersLock.Lock()
defer enhancedAuthTokenPrunerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenPrunerServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedLoginProviderServers = make(map[string]LoginProviderEnhancedServer)
enhancedLoginProviderServersLock = sync.RWMutex{}
)
type NamedLoginProviderServer interface {
LoginProviderServer
Name() string
}
type LoginProviderEnhancedServer map[string]NamedLoginProviderServer
func (m LoginProviderEnhancedServer) GetLogin(ctx context.Context, r *GetLoginRequest) (*GetLoginResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method GetLogin should have a context")
}
enhancedLoginProviderServersLock.RLock()
defer enhancedLoginProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.GetLogin(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method GetLogin not implemented")
}
func (m LoginProviderEnhancedServer) CreateLogin(ctx context.Context, r *CreateLoginRequest) (*CreateLoginResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method CreateLogin should have a context")
}
enhancedLoginProviderServersLock.RLock()
defer enhancedLoginProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.CreateLogin(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method CreateLogin not implemented")
}
func (m LoginProviderEnhancedServer) AcceptLogin(ctx context.Context, r *AcceptLoginRequest) (*AcceptLoginResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method AcceptLogin should have a context")
}
enhancedLoginProviderServersLock.RLock()
defer enhancedLoginProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.AcceptLogin(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method AcceptLogin not implemented")
}
func (m LoginProviderEnhancedServer) mustEmbedUnimplementedLoginProviderServer() {}
func RegisterLoginProviderEnhancedServer(s grpc.ServiceRegistrar, srv NamedLoginProviderServer) {
enhancedLoginProviderServersLock.Lock()
defer enhancedLoginProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedLoginProviderServers[addr]
if !ok {
m = LoginProviderEnhancedServer{}
enhancedLoginProviderServers[addr] = m
RegisterLoginProviderServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterLoginProviderEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedLoginProviderServersLock.Lock()
defer enhancedLoginProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedLoginProviderServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedConsentProviderServers = make(map[string]ConsentProviderEnhancedServer)
enhancedConsentProviderServersLock = sync.RWMutex{}
)
type NamedConsentProviderServer interface {
ConsentProviderServer
Name() string
}
type ConsentProviderEnhancedServer map[string]NamedConsentProviderServer
func (m ConsentProviderEnhancedServer) GetConsent(ctx context.Context, r *GetConsentRequest) (*GetConsentResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method GetConsent should have a context")
}
enhancedConsentProviderServersLock.RLock()
defer enhancedConsentProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.GetConsent(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method GetConsent not implemented")
}
func (m ConsentProviderEnhancedServer) CreateConsent(ctx context.Context, r *CreateConsentRequest) (*CreateConsentResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method CreateConsent should have a context")
}
enhancedConsentProviderServersLock.RLock()
defer enhancedConsentProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.CreateConsent(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method CreateConsent not implemented")
}
func (m ConsentProviderEnhancedServer) AcceptConsent(ctx context.Context, r *AcceptConsentRequest) (*AcceptConsentResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method AcceptConsent should have a context")
}
enhancedConsentProviderServersLock.RLock()
defer enhancedConsentProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.AcceptConsent(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method AcceptConsent not implemented")
}
func (m ConsentProviderEnhancedServer) mustEmbedUnimplementedConsentProviderServer() {}
func RegisterConsentProviderEnhancedServer(s grpc.ServiceRegistrar, srv NamedConsentProviderServer) {
enhancedConsentProviderServersLock.Lock()
defer enhancedConsentProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedConsentProviderServers[addr]
if !ok {
m = ConsentProviderEnhancedServer{}
enhancedConsentProviderServers[addr] = m
RegisterConsentProviderServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterConsentProviderEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedConsentProviderServersLock.Lock()
defer enhancedConsentProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedConsentProviderServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedLogoutProviderServers = make(map[string]LogoutProviderEnhancedServer)
enhancedLogoutProviderServersLock = sync.RWMutex{}
)
type NamedLogoutProviderServer interface {
LogoutProviderServer
Name() string
}
type LogoutProviderEnhancedServer map[string]NamedLogoutProviderServer
func (m LogoutProviderEnhancedServer) CreateLogout(ctx context.Context, r *CreateLogoutRequest) (*CreateLogoutResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method CreateLogout should have a context")
}
enhancedLogoutProviderServersLock.RLock()
defer enhancedLogoutProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.CreateLogout(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method CreateLogout not implemented")
}
func (m LogoutProviderEnhancedServer) AcceptLogout(ctx context.Context, r *AcceptLogoutRequest) (*AcceptLogoutResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method AcceptLogout should have a context")
}
enhancedLogoutProviderServersLock.RLock()
defer enhancedLogoutProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.AcceptLogout(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method AcceptLogout not implemented")
}
func (m LogoutProviderEnhancedServer) mustEmbedUnimplementedLogoutProviderServer() {}
func RegisterLogoutProviderEnhancedServer(s grpc.ServiceRegistrar, srv NamedLogoutProviderServer) {
enhancedLogoutProviderServersLock.Lock()
defer enhancedLogoutProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedLogoutProviderServers[addr]
if !ok {
m = LogoutProviderEnhancedServer{}
enhancedLogoutProviderServers[addr] = m
RegisterLogoutProviderServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterLogoutProviderEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedLogoutProviderServersLock.Lock()
defer enhancedLogoutProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedLogoutProviderServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedAuthCodeProviderServers = make(map[string]AuthCodeProviderEnhancedServer)
enhancedAuthCodeProviderServersLock = sync.RWMutex{}
)
type NamedAuthCodeProviderServer interface {
AuthCodeProviderServer
Name() string
}
type AuthCodeProviderEnhancedServer map[string]NamedAuthCodeProviderServer
func (m AuthCodeProviderEnhancedServer) CreateAuthCode(ctx context.Context, r *CreateAuthCodeRequest) (*CreateAuthCodeResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method CreateAuthCode should have a context")
}
enhancedAuthCodeProviderServersLock.RLock()
defer enhancedAuthCodeProviderServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.CreateAuthCode(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method CreateAuthCode not implemented")
}
func (m AuthCodeProviderEnhancedServer) mustEmbedUnimplementedAuthCodeProviderServer() {}
func RegisterAuthCodeProviderEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthCodeProviderServer) {
enhancedAuthCodeProviderServersLock.Lock()
defer enhancedAuthCodeProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthCodeProviderServers[addr]
if !ok {
m = AuthCodeProviderEnhancedServer{}
enhancedAuthCodeProviderServers[addr] = m
RegisterAuthCodeProviderServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthCodeProviderEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthCodeProviderServersLock.Lock()
defer enhancedAuthCodeProviderServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthCodeProviderServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedAuthTokenVerifierServers = make(map[string]AuthTokenVerifierEnhancedServer)
enhancedAuthTokenVerifierServersLock = sync.RWMutex{}
)
type NamedAuthTokenVerifierServer interface {
AuthTokenVerifierServer
Name() string
}
type AuthTokenVerifierEnhancedServer map[string]NamedAuthTokenVerifierServer
// Verifies a token and returns claims
func (m AuthTokenVerifierEnhancedServer) Verify(ctx context.Context, r *VerifyTokenRequest) (*VerifyTokenResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Verify should have a context")
}
enhancedAuthTokenVerifierServersLock.RLock()
defer enhancedAuthTokenVerifierServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Verify(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Verify not implemented")
}
func (m AuthTokenVerifierEnhancedServer) mustEmbedUnimplementedAuthTokenVerifierServer() {}
func RegisterAuthTokenVerifierEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthTokenVerifierServer) {
enhancedAuthTokenVerifierServersLock.Lock()
defer enhancedAuthTokenVerifierServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenVerifierServers[addr]
if !ok {
m = AuthTokenVerifierEnhancedServer{}
enhancedAuthTokenVerifierServers[addr] = m
RegisterAuthTokenVerifierServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthTokenVerifierEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthTokenVerifierServersLock.Lock()
defer enhancedAuthTokenVerifierServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenVerifierServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedAuthCodeExchangerServers = make(map[string]AuthCodeExchangerEnhancedServer)
enhancedAuthCodeExchangerServersLock = sync.RWMutex{}
)
type NamedAuthCodeExchangerServer interface {
AuthCodeExchangerServer
Name() string
}
type AuthCodeExchangerEnhancedServer map[string]NamedAuthCodeExchangerServer
func (m AuthCodeExchangerEnhancedServer) Exchange(ctx context.Context, r *ExchangeRequest) (*ExchangeResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Exchange should have a context")
}
enhancedAuthCodeExchangerServersLock.RLock()
defer enhancedAuthCodeExchangerServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Exchange(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Exchange not implemented")
}
func (m AuthCodeExchangerEnhancedServer) mustEmbedUnimplementedAuthCodeExchangerServer() {}
func RegisterAuthCodeExchangerEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthCodeExchangerServer) {
enhancedAuthCodeExchangerServersLock.Lock()
defer enhancedAuthCodeExchangerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthCodeExchangerServers[addr]
if !ok {
m = AuthCodeExchangerEnhancedServer{}
enhancedAuthCodeExchangerServers[addr] = m
RegisterAuthCodeExchangerServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthCodeExchangerEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthCodeExchangerServersLock.Lock()
defer enhancedAuthCodeExchangerServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthCodeExchangerServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedPasswordCredentialsTokenServers = make(map[string]PasswordCredentialsTokenEnhancedServer)
enhancedPasswordCredentialsTokenServersLock = sync.RWMutex{}
)
type NamedPasswordCredentialsTokenServer interface {
PasswordCredentialsTokenServer
Name() string
}
type PasswordCredentialsTokenEnhancedServer map[string]NamedPasswordCredentialsTokenServer
func (m PasswordCredentialsTokenEnhancedServer) PasswordCredentialsToken(ctx context.Context, r *PasswordCredentialsTokenRequest) (*PasswordCredentialsTokenResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method PasswordCredentialsToken should have a context")
}
enhancedPasswordCredentialsTokenServersLock.RLock()
defer enhancedPasswordCredentialsTokenServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.PasswordCredentialsToken(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method PasswordCredentialsToken not implemented")
}
func (m PasswordCredentialsTokenEnhancedServer) mustEmbedUnimplementedPasswordCredentialsTokenServer() {
}
func RegisterPasswordCredentialsTokenEnhancedServer(s grpc.ServiceRegistrar, srv NamedPasswordCredentialsTokenServer) {
enhancedPasswordCredentialsTokenServersLock.Lock()
defer enhancedPasswordCredentialsTokenServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedPasswordCredentialsTokenServers[addr]
if !ok {
m = PasswordCredentialsTokenEnhancedServer{}
enhancedPasswordCredentialsTokenServers[addr] = m
RegisterPasswordCredentialsTokenServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterPasswordCredentialsTokenEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedPasswordCredentialsTokenServersLock.Lock()
defer enhancedPasswordCredentialsTokenServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedPasswordCredentialsTokenServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedAuthTokenRefresherServers = make(map[string]AuthTokenRefresherEnhancedServer)
enhancedAuthTokenRefresherServersLock = sync.RWMutex{}
)
type NamedAuthTokenRefresherServer interface {
AuthTokenRefresherServer
Name() string
}
type AuthTokenRefresherEnhancedServer map[string]NamedAuthTokenRefresherServer
func (m AuthTokenRefresherEnhancedServer) Refresh(ctx context.Context, r *RefreshTokenRequest) (*RefreshTokenResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Refresh should have a context")
}
enhancedAuthTokenRefresherServersLock.RLock()
defer enhancedAuthTokenRefresherServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Refresh(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented")
}
func (m AuthTokenRefresherEnhancedServer) mustEmbedUnimplementedAuthTokenRefresherServer() {}
func RegisterAuthTokenRefresherEnhancedServer(s grpc.ServiceRegistrar, srv NamedAuthTokenRefresherServer) {
enhancedAuthTokenRefresherServersLock.Lock()
defer enhancedAuthTokenRefresherServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenRefresherServers[addr]
if !ok {
m = AuthTokenRefresherEnhancedServer{}
enhancedAuthTokenRefresherServers[addr] = m
RegisterAuthTokenRefresherServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterAuthTokenRefresherEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedAuthTokenRefresherServersLock.Lock()
defer enhancedAuthTokenRefresherServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedAuthTokenRefresherServers[addr]
if !ok {
return
}
delete(m, name)
}
var (
enhancedPersonalAccessTokenServiceServers = make(map[string]PersonalAccessTokenServiceEnhancedServer)
enhancedPersonalAccessTokenServiceServersLock = sync.RWMutex{}
)
type NamedPersonalAccessTokenServiceServer interface {
PersonalAccessTokenServiceServer
Name() string
}
type PersonalAccessTokenServiceEnhancedServer map[string]NamedPersonalAccessTokenServiceServer
func (m PersonalAccessTokenServiceEnhancedServer) Generate(ctx context.Context, r *PatGenerateRequest) (*PatGenerateResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Generate should have a context")
}
enhancedPersonalAccessTokenServiceServersLock.RLock()
defer enhancedPersonalAccessTokenServiceServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Generate(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented")
}
func (m PersonalAccessTokenServiceEnhancedServer) Revoke(ctx context.Context, r *PatRevokeRequest) (*PatRevokeResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method Revoke should have a context")
}
enhancedPersonalAccessTokenServiceServersLock.RLock()
defer enhancedPersonalAccessTokenServiceServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.Revoke(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
}
func (m PersonalAccessTokenServiceEnhancedServer) List(ctx context.Context, r *PatListRequest) (*PatListResponse, error) {
md, ok := metadata.FromIncomingContext(ctx)
if !ok || len(md.Get("targetname")) == 0 {
return nil, status.Errorf(codes.FailedPrecondition, "method List should have a context")
}
enhancedPersonalAccessTokenServiceServersLock.RLock()
defer enhancedPersonalAccessTokenServiceServersLock.RUnlock()
for _, mm := range m {
if mm.Name() == md.Get("targetname")[0] {
return mm.List(ctx, r)
}
}
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (m PersonalAccessTokenServiceEnhancedServer) mustEmbedUnimplementedPersonalAccessTokenServiceServer() {
}
func RegisterPersonalAccessTokenServiceEnhancedServer(s grpc.ServiceRegistrar, srv NamedPersonalAccessTokenServiceServer) {
enhancedPersonalAccessTokenServiceServersLock.Lock()
defer enhancedPersonalAccessTokenServiceServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedPersonalAccessTokenServiceServers[addr]
if !ok {
m = PersonalAccessTokenServiceEnhancedServer{}
enhancedPersonalAccessTokenServiceServers[addr] = m
RegisterPersonalAccessTokenServiceServer(s, m)
}
m[srv.Name()] = srv
}
func DeregisterPersonalAccessTokenServiceEnhancedServer(s grpc.ServiceRegistrar, name string) {
enhancedPersonalAccessTokenServiceServersLock.Lock()
defer enhancedPersonalAccessTokenServiceServersLock.Unlock()
addr := fmt.Sprintf("%p", s)
m, ok := enhancedPersonalAccessTokenServiceServers[addr]
if !ok {
return
}
delete(m, name)
}