This repository was archived by the owner on Oct 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.gen.go
More file actions
1888 lines (1497 loc) · 84 KB
/
api.gen.go
File metadata and controls
1888 lines (1497 loc) · 84 KB
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
// Package api provides primitives to interact the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package api
import (
"bytes"
"compress/gzip"
"encoding/base64"
"fmt"
"github.com/deepmap/oapi-codegen/pkg/runtime"
openapi_types "github.com/deepmap/oapi-codegen/pkg/types"
"github.com/getkin/kin-openapi/openapi3"
"github.com/labstack/echo/v4"
"net/http"
"strings"
"time"
)
// ChangePasswordRequest defines model for ChangePasswordRequest.
type ChangePasswordRequest struct {
// The new password to set.
NewPassword string `json:"new_password"`
// The old or existing password
OldPassword string `json:"old_password"`
}
// Claim defines model for Claim.
type Claim struct {
// A short dercription about the claim.
Description *string `json:"description,omitempty"`
// Internal identifier of the claim
Id int `json:"id"`
// A alphanumeric name, to represent claim name in OAuth2 claim.
Name string `json:"name"`
}
// ClaimPage defines model for ClaimPage.
type ClaimPage struct {
// Embedded fields due to inline allOf schema
// an array of claims
Claims []Claim `json:"claims"`
// Embedded struct due to allOf(#/components/schemas/Page)
Page
}
// Error defines model for Error.
type Error struct {
// Error code
Error *string `json:"error,omitempty"`
// Detail description
Message *string `json:"message,omitempty"`
}
// Page defines model for Page.
type Page struct {
// Page number of the response chunk
PageNumber int32 `json:"page_number"`
// Total available pages
PageTotal int32 `json:"page_total"`
}
// Scope defines model for Scope.
type Scope struct {
// A short dercription about the scope.
Description *string `json:"description,omitempty"`
// Internal identifier of the scope
Id int `json:"id"`
// Scope name. alphanumeric characters only.
Name string `json:"name"`
}
// Secret defines model for Secret.
type Secret struct {
// Suitable algorithm for the key. allowed values are all supported `JWS` and `JWK` algorithms.
Algorithm string `json:"algorithm"`
// Date when the secret expires
ExpiresAt time.Time `json:"expires_at"`
// Date when the key was issued
IssuedAt time.Time `json:"issued_at"`
// usage of the key
KeyUsage string `json:"key_usage"`
}
// SecretChannel defines model for SecretChannel.
type SecretChannel struct {
// Suitable algorithm for the key. allowed values are all supported `JWS` and `JWK` algorithms.
Algorithm string `json:"algorithm"`
// Identifier of the `SecretChannel`.
Id int `json:"id"`
// usage of the key
KeyUsage string `json:"key_usage"`
// A friendly name for the key channel
Name string `json:"name"`
// A list of secrets associates with channel
Secrets []Secret `json:"secrets"`
// How mant days the key will be valid, when generated or renewed
ValidityDay int32 `json:"validity_day"`
}
// SecretChannelPage defines model for SecretChannelPage.
type SecretChannelPage struct {
// Embedded fields due to inline allOf schema
// Embedded struct due to allOf(#/components/schemas/Page)
Page
}
// SecretChannelSummary defines model for SecretChannelSummary.
type SecretChannelSummary struct {
// Suitable algorithm for the key. allowed values are all supported `JWS` and `JWK` algorithms.
Algorithm string `json:"algorithm"`
// Identifier of the `SecretChannel`.
Id int `json:"id"`
// usage of the key
KeyUsage string `json:"key_usage"`
// A friendly name for the key channel
Name string `json:"name"`
}
// ServiceProvider defines model for ServiceProvider.
type ServiceProvider struct {
// Embedded fields due to inline allOf schema
// Kind of the application. The default, if omitted, is web. The defined values are native or web. Web Clients using the OAuth Implicit Grant Type MUST only register URLs using the https scheme as redirect_uris; they MUST NOT use localhost as the hostname. Native Clients MUST only register redirect_uris using custom URI schemes or URLs using the http: scheme with localhost as the hostname. Authorization Servers MAY place additional constraints on Native Clients. Authorization Servers MAY reject Redirection URI values using the http scheme, other than the localhost case for Native Clients. The Authorization Server MUST verify that all the registered redirect_uris conform to these constraints. This prevents sharing a Client ID across different types of Clients.
ApplicationType string `json:"application_type"`
// JSON array containing a list of the OAuth 2.0 Grant Types that the Client is declaring that it will restrict itself to using. The Grant Type values used by
//
// OpenID Connect are:
// 1. authorization_code: The Authorization Code Grant Type described in OAuth 2.0 Section 4.1.
// 1. implicit: The Implicit Grant Type described in OAuth 2.0 Section 4.2.
// 1. refresh_token: The Refresh Token Grant Type described in OAuth 2.0 Section 6.
//
// The following table lists the correspondence between response_type values that the Client will use and grant_type values that MUST be included in the registered grant_types list:
//
// 1. code: authorization_code
// 1. id_token: implicit
// 1. token id_token: implicit
// 1. code id_token: authorization_code, implicit
// 1. code token: authorization_code, implicit
// 1. code token id_token: authorization_code, implicit
//
// If omitted, the default is that the Client will use only the authorization_code Grant Type.
GrantTypes []string `json:"grant_types"`
// Name of the Client to be presented to the End-User. If desired, representation of this Claim in different languages and scripts is represented as described in Section 2.1.
Name string `json:"name"`
// Array of Redirection URI values used by the Client. One of these registered Redirection URI values MUST exactly match the redirect_uri parameter value used in each Authorization Request, with the matching performed as described in Section 6.2.1 of [RFC3986] (Simple String Comparison).
RedirectUris []string `json:"redirect_uris"`
// Array of request_uri values that are pre-registered by the RP for use at the OP. Servers MAY cache the contents of the files referenced by these URIs and not retrieve them at the time they are used in a request. OPs can require that request_uri values used be pre-registered with the require_request_uri_registration discovery parameter.
// If the contents of the request file could ever change, these URI values SHOULD include the base64url encoded SHA-256 hash value of the file contents referenced by the URI as the value of the URI fragment. If the fragment value used for a URI changes, that signals the server that its cached value for that URI with the old fragment value is no longer valid.
RequestUris *[]string `json:"request_uris,omitempty"`
// Approved oauth scopes for the service providers
Scope []string `json:"scope"`
// Embedded struct due to allOf(#/components/schemas/ServiceProviderInfo)
ServiceProviderInfo
// Embedded struct due to allOf(#/components/schemas/ServiceProviderConfig)
ServiceProviderConfig
}
// ServiceProviderConfig defines model for ServiceProviderConfig.
type ServiceProviderConfig struct {
// Default Maximum Authentication Age. Specifies that the End-User MUST be actively authenticated if the End-User was authenticated longer ago than the specified number of seconds. The max_age request parameter overrides this default value. If omitted, no default Maximum Authentication Age is specified.
DefaultMaxAge *string `json:"default_max_age,omitempty"`
// JWE alg algorithm [JWA] REQUIRED for encrypting the ID Token issued to this Client. If this is requested, the response will be signed then encrypted, with the result being a Nested JWT, as defined in [JWT]. The default, if omitted, is that no encryption is performed.
IdTokenEncryptedResponseAlg *string `json:"id_token_encrypted_response_alg,omitempty"`
// JWE enc algorithm [JWA] REQUIRED for encrypting the ID Token issued to this Client. If id_token_encrypted_response_alg is specified, the default for this value is A128CBC-HS256. When id_token_encrypted_response_enc is included, id_token_encrypted_response_alg MUST also be provided.
IdTokenEncryptedResponseEnc *string `json:"id_token_encrypted_response_enc,omitempty"`
// JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If this is specified, the response will be JWT [JWT] serialized, and signed using JWS. The default, if omitted, is for the UserInfo Response to return the Claims as a UTF-8 encoded JSON object using the application/json content-type.
IdTokenSignedResponseAlg *string `json:"id_token_signed_response_alg,omitempty"`
// Client's JSON Web Key Set [JWK] document, passed by value. The semantics of the jwks parameter are the same as the jwks_uri parameter, other than that the JWK Set is passed by value, rather than by reference. This parameter is intended only to be used by Clients that, for some reason, are unable to use the jwks_uri parameter, for instance, by native applications that might not have a location to host the contents of the JWK Set. If a Client can use jwks_uri, it MUST NOT use jwks. One significant downside of jwks is that it does not enable key rotation (which jwks_uri does, as described in Section 10 of OpenID Connect Core 1.0 [OpenID.Core]). The jwks_uri and jwks parameters MUST NOT be used together.
Jwks *string `json:"jwks,omitempty"`
// URL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains the signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the Client's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate.
JwksUri *string `json:"jwks_uri,omitempty"`
// JWE [JWE] alg algorithm [JWA] the RP is declaring that it may use for encrypting Request Objects sent to the OP. This parameter SHOULD be included when symmetric encryption will be used, since this signals to the OP that a client_secret value needs to be returned from which the symmetric key will be derived, that might not otherwise be returned. The RP MAY still use other supported encryption algorithms or send unencrypted Request Objects, even when this parameter is present. If both signing and encryption are requested, the Request Object will be signed then encrypted, with the result being a Nested JWT, as defined in [JWT]. The default, if omitted, is that the RP is not declaring whether it might encrypt any Request Objects.
RequestObjectEncryptionAlg *string `json:"request_object_encryption_alg,omitempty"`
// JWE enc algorithm [JWA] the RP is declaring that it may use for encrypting Request Objects sent to the OP. If request_object_encryption_alg is specified, the default for this value is A128CBC-HS256. When request_object_encryption_enc is included, request_object_encryption_alg MUST also be provided.
RequestObjectEncryptionEnc *string `json:"request_object_encryption_enc,omitempty"`
// JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects from this Client MUST be rejected, if not signed with this algorithm. Request Objects are described in Section 6.1 of OpenID Connect Core 1.0 [OpenID.Core]. This algorithm MUST be used both when the Request Object is passed by value (using the request parameter) and when it is passed by reference (using the request_uri parameter). Servers SHOULD support RS256. The value none MAY be used. The default, if omitted, is that any algorithm supported by the OP and the RP MAY be used.
RequestObjectSigningAlg *string `json:"request_object_signing_alg,omitempty"`
// Boolean value specifying whether the auth_time Claim in the ID Token is REQUIRED. It is REQUIRED when the value is true. (If this is false, the auth_time Claim can still be dynamically requested as an individual Claim for the ID Token using the claims request parameter described in Section 5.5.1 of OpenID Connect Core 1.0 [OpenID.Core].) If omitted, the default value is false.
RequireAuthTime *string `json:"require_auth_time,omitempty"`
// Requested Client Authentication method for the Token Endpoint. The options are client_secret_post, client_secret_basic, client_secret_jwt, private_key_jwt, and none, as described in Section 9 of OpenID Connect Core 1.0 [OpenID.Core]. Other authentication methods MAY be defined by extensions. If omitted, the default is client_secret_basic -- the HTTP Basic Authentication Scheme specified in Section 2.3.1 of OAuth 2.0 [RFC6749].
TokenEndpointAuthMethod *string `json:"token_endpoint_auth_method,omitempty"`
// JWS [JWS] alg algorithm [JWA] that MUST be used for signing the JWT [JWT] used to authenticate the Client at the Token Endpoint for the private_key_jwt and client_secret_jwt authentication methods. All Token Requests using these authentication methods from this Client MUST be rejected, if the JWT is not signed with this algorithm. Servers SHOULD support RS256. The value none MUST NOT be used. The default, if omitted, is that any algorithm supported by the OP and the RP MAY be used.
TokenEndpointAuthSigningAlg *string `json:"token_endpoint_auth_signing_alg,omitempty"`
// JWE [JWE] alg algorithm [JWA] REQUIRED for encrypting UserInfo Responses. If both signing and encryption are requested, the response will be signed then encrypted, with the result being a Nested JWT, as defined in [JWT]. The default, if omitted, is that no encryption is performed.
UserinfoEncryptedResponseAlg *string `json:"userinfo_encrypted_response_alg,omitempty"`
// JWE enc algorithm [JWA] REQUIRED for encrypting UserInfo Responses. If userinfo_encrypted_response_alg is specified, the default for this value is A128CBC-HS256. When userinfo_encrypted_response_enc is included, userinfo_encrypted_response_alg MUST also be provided.
UserinfoEncryptedResponseEnc *string `json:"userinfo_encrypted_response_enc,omitempty"`
// JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If this is specified, the response will be JWT [JWT] serialized, and signed using JWS. The default, if omitted, is for the UserInfo Response to return the Claims as a UTF-8 encoded JSON object using the application/json content-type.
UserinfoSignedResponseAlg *string `json:"userinfo_signed_response_alg,omitempty"`
}
// ServiceProviderCredentials defines model for ServiceProviderCredentials.
type ServiceProviderCredentials struct {
// Client identifier
ClientId string `json:"client_id"`
// Client secret
ClientSecret string `json:"client_secret"`
}
// ServiceProviderInfo defines model for ServiceProviderInfo.
type ServiceProviderInfo struct {
// URL of the home page of the Client. The value of this field MUST point to a valid Web page. If present, the server SHOULD display this URL to the End-User in a followable fashion. If desired, representation of this Claim in different languages and scripts is represented as described in Section 2.1.
ClientUri *string `json:"client_uri,omitempty"`
// Array of e-mail addresses of people responsible for this Client. This might be used by some providers to enable a Web user interface to modify the Client information.
Contacts *[]string `json:"contacts,omitempty"`
// URI using the https scheme that a third party can use to initiate a login by the RP, as specified in Section 4 of OpenID Connect Core 1.0 [OpenID.Core]. The URI MUST accept requests via both GET and POST. The Client MUST understand the login_hint and iss parameters and SHOULD support the target_link_uri parameter.
InitiateLoginUri *string `json:"initiate_login_uri,omitempty"`
// URL that references a logo for the Client application. If present, the server SHOULD display this image to the End-User during approval. The value of this field MUST point to a valid image file. If desired, representation of this Claim in different languages and scripts is represented as described in Section 2.1.
LogoUri *string `json:"logo_uri,omitempty"`
// URL that the Relying Party Client provides to the End-User to read about the how the profile data will be used. The value of this field MUST point to a valid web page. The OpenID Provider SHOULD display this URL to the End-User if it is given. If desired, representation of this Claim in different languages and scripts is represented as described in Section 2.1.
PolicyUri *string `json:"policy_uri,omitempty"`
// URL that the Relying Party Client provides to the End-User to read about the Relying Party's terms of service. The value of this field MUST point to a valid web page. The OpenID Provider SHOULD display this URL to the End-User if it is given. If desired, representation of this Claim in different languages and scripts is represented as described in Section 2.1.
TosUri *string `json:"tos_uri,omitempty"`
}
// ServiceProviderSummary defines model for ServiceProviderSummary.
type ServiceProviderSummary struct {
// Identifier of the provider.
Id int `json:"id"`
}
// ServiceProviderSummaryPage defines model for ServiceProviderSummaryPage.
type ServiceProviderSummaryPage struct {
// Embedded fields due to inline allOf schema
// An array of service provider summary in one page.
ServiceProviders []ServiceProviderSummary `json:"service_providers"`
// Embedded struct due to allOf(#/components/schemas/Page)
Page
}
// User defines model for User.
type User struct {
// Embedded fields due to inline allOf schema
// End-User's preferred postal address. The value of the address member is a JSON [RFC4627] structure containing some or all of the members defined in Section 5.1.1.
Address *UserAddress `json:"address,omitempty"`
// End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. The year MAY be 0000, indicating that it is omitted. To represent only the year, YYYY format is allowed. Note that depending on the underlying platform's date related function, providing just year can result in varying month and day, so the implementers need to take this factor into account to correctly process the dates.
Birthdate *openapi_types.Date `json:"birthdate,omitempty"`
// End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable.
Gender *string `json:"gender,omitempty"`
// User identifier.
Id int `json:"id"`
// End-User's locale, represented as a BCP47 [RFC5646] language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. For example, en-US or fr-CA. As a compatibility note, some implementations have used an underscore as the separator rather than a dash, for example, en_US; Relying Parties MAY choose to accept this locale syntax as well.
Locale *string `json:"locale,omitempty"`
// Username for login
Username string `json:"username"`
// String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles.
Zoneinfo *string `json:"zoneinfo,omitempty"`
// Embedded struct due to allOf(#/components/schemas/UserName)
UserName
// Embedded struct due to allOf(#/components/schemas/UserProfile)
UserProfile
// Embedded struct due to allOf(#/components/schemas/UserContact)
UserContact
// Embedded struct due to allOf(#/components/schemas/UserAddress)
UserAddress
}
// UserAddress defines model for UserAddress.
type UserAddress struct {
// Country name component.
Country *string `json:"country,omitempty"`
// Full mailing address, formatted for display or use on a mailing label. This field MAY contain multiple lines, separated by newlines. Newlines can be represented either as a carriage return/line feed pair ("\r\n") or as a single line feed character ("\n").
Formatted *string `json:"formatted,omitempty"`
// City or locality component.
Locality *string `json:"locality,omitempty"`
// Zip code or postal code component.
PostalCode *string `json:"postal_code,omitempty"`
// State, province, prefecture, or region component.
Region *string `json:"region,omitempty"`
// Full street address component, which MAY include house number, street name, Post Office Box, and multi-line extended street address information. This field MAY contain multiple lines, separated by newlines. Newlines can be represented either as a carriage return/line feed pair ("\r\n") or as a single line feed character ("\n").
StreetAddress *string `json:"street_address,omitempty"`
}
// UserContact defines model for UserContact.
type UserContact struct {
// End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.
Email *string `json:"email,omitempty"`
// True if the End-User's e-mail address has been verified; otherwise false. When this Claim Value is true, this means that the OP took affirmative steps to ensure that this e-mail address was controlled by the End-User at the time the verification was performed. The means by which an e-mail address is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating.
EmailVerified *bool `json:"email_verified,omitempty"`
// End-User's preferred telephone number. E.164 [E.164] is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400. If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678.
PhoneNumber *string `json:"phone_number,omitempty"`
// User at the time the verification was performed. The means by which a phone number is verified is context-specific, and dependent upon the trust framework or contractual agreements within which the parties are operating. When true, the phone_number Claim MUST be in E.164 format and any extensions MUST be represented in RFC 3966 format.
PhoneNumberVerified *bool `json:"phone_number_verified,omitempty"`
}
// UserName defines model for UserName.
type UserName struct {
// Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters.
FamilyName *string `json:"family_name,omitempty"`
// Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters.
GivenName *string `json:"given_name,omitempty"`
// Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used.
MiddleName *string `json:"middle_name,omitempty"`
// End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
Name *string `json:"name,omitempty"`
// Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael.
Nickname *string `json:"nickname,omitempty"`
// Shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. The RP MUST NOT rely upon this value being unique.
PreferredUsername *string `json:"preferred_username,omitempty"`
}
// UserProfile defines model for UserProfile.
type UserProfile struct {
// URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User.
Picture *string `json:"picture,omitempty"`
// URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User.
Profile *string `json:"profile,omitempty"`
// URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with.
Website *string `json:"website,omitempty"`
}
// UserRecoverPassword defines model for UserRecoverPassword.
type UserRecoverPassword struct {
// Email id of the user to confirm with user store
Email string `json:"email"`
// Username of the user
Username string `json:"username"`
}
// UserResetPassword defines model for UserResetPassword.
type UserResetPassword struct {
// One time password received through initiation process
Otp string `json:"otp"`
// Username of the user
Username string `json:"username"`
}
// UserStatusUpdate defines model for UserStatusUpdate.
type UserStatusUpdate struct {
// New status to change to.
Active bool `json:"active"`
}
// UserSummary defines model for UserSummary.
type UserSummary struct {
// User is active or inactive
Active *bool `json:"active,omitempty"`
// User is blocked by invalid attempt
Blocked *bool `json:"blocked,omitempty"`
// Email address
Email *string `json:"email,omitempty"`
// Login username
Username *string `json:"username,omitempty"`
}
// UserSummaryPage defines model for UserSummaryPage.
type UserSummaryPage struct {
// Embedded fields due to inline allOf schema
// A collection of users
Users []UserSummary `json:"users"`
// Embedded struct due to allOf(#/components/schemas/Page)
Page
}
// UnAuthorized defines model for UnAuthorized.
type UnAuthorized Error
// GetClaimsParams defines parameters for GetClaims.
type GetClaimsParams struct {
// Number of items in each page.
// Default value is 10.
PageSize *int `json:"page_size,omitempty"`
// Page number to return in response.
// Starts with 1 and default value is 1 too.
PageNumber *int `json:"page_number,omitempty"`
}
// CreateClaimJSONBody defines parameters for CreateClaim.
type CreateClaimJSONBody Claim
// FindClaimByNameParams defines parameters for FindClaimByName.
type FindClaimByNameParams struct {
// name of the claim
Name string `json:"name"`
}
// UpdateClaimJSONBody defines parameters for UpdateClaim.
type UpdateClaimJSONBody Claim
// GetScopesParams defines parameters for GetScopes.
type GetScopesParams struct {
// Number of items in each page.
// Default value is 10.
PageSize *int `json:"page_size,omitempty"`
// Page number to return in response.
// Starts with 1 and default value is 1 too.
PageNumber *int `json:"page_number,omitempty"`
}
// CreateScopeJSONBody defines parameters for CreateScope.
type CreateScopeJSONBody Scope
// FindScopeByNameParams defines parameters for FindScopeByName.
type FindScopeByNameParams struct {
// scope name
Name string `json:"name"`
}
// UpdateScopeJSONBody defines parameters for UpdateScope.
type UpdateScopeJSONBody Scope
// GetSecretChannelsParams defines parameters for GetSecretChannels.
type GetSecretChannelsParams struct {
// Number of items in each page.
// Default value is 10.
PageSize *int `json:"page_size,omitempty"`
// Page number to return in response.
// Starts with 1 and default value is 1 too.
PageNumber *int `json:"page_number,omitempty"`
}
// CreateSecretChannelJSONBody defines parameters for CreateSecretChannel.
type CreateSecretChannelJSONBody SecretChannel
// FindSecretChannelByAlgouseParams defines parameters for FindSecretChannelByAlgouse.
type FindSecretChannelByAlgouseParams struct {
// algorithm of the channel
Algo string `json:"algo"`
// usage of the secret channel
Use string `json:"use"`
}
// FindSecretChannelByNameParams defines parameters for FindSecretChannelByName.
type FindSecretChannelByNameParams struct {
// name of the secret channel
Name string `json:"name"`
}
// UpdateSecretChannelJSONBody defines parameters for UpdateSecretChannel.
type UpdateSecretChannelJSONBody SecretChannel
// GetServiceProvidersParams defines parameters for GetServiceProviders.
type GetServiceProvidersParams struct {
// Number of items in each page.
// Default value is 10.
PageSize *int `json:"page_size,omitempty"`
// Page number to return in response.
// Starts with 1 and default value is 1 too.
PageNumber *int `json:"page_number,omitempty"`
}
// CreateServiceProviderJSONBody defines parameters for CreateServiceProvider.
type CreateServiceProviderJSONBody ServiceProvider
// FindServiceProviderParams defines parameters for FindServiceProvider.
type FindServiceProviderParams struct {
// service provider name
Name *string `json:"name,omitempty"`
// service provider client id
ClientId *int `json:"client_id,omitempty"`
}
// PatchServiceProviderJSONBody defines parameters for PatchServiceProvider.
type PatchServiceProviderJSONBody ServiceProvider
// UpdateServiceProviderJSONBody defines parameters for UpdateServiceProvider.
type UpdateServiceProviderJSONBody ServiceProvider
// GenerateCredentialsParams defines parameters for GenerateCredentials.
type GenerateCredentialsParams struct {
// Indicates wheather to refresh the client_id of not. Default is `false`.
RefreshId *bool `json:"refresh_id,omitempty"`
}
// GetUsersParams defines parameters for GetUsers.
type GetUsersParams struct {
// Number of items in each page.
// Default value is 10.
PageSize *int `json:"page_size,omitempty"`
// Page number to return in response.
// Starts with 1 and default value is 1 too.
PageNumber *int `json:"page_number,omitempty"`
}
// CreateUserJSONBody defines parameters for CreateUser.
type CreateUserJSONBody User
// FindUserParams defines parameters for FindUser.
type FindUserParams struct {
// Username of the user
Username *string `json:"username,omitempty"`
// email of the user
Email *string `json:"email,omitempty"`
}
// InitiatePasswordRecoveryJSONBody defines parameters for InitiatePasswordRecovery.
type InitiatePasswordRecoveryJSONBody UserRecoverPassword
// ResetUserPasswordJSONBody defines parameters for ResetUserPassword.
type ResetUserPasswordJSONBody UserResetPassword
// UpdateUserJSONBody defines parameters for UpdateUser.
type UpdateUserJSONBody User
// ChangeUserPasswordJSONBody defines parameters for ChangeUserPassword.
type ChangeUserPasswordJSONBody ChangePasswordRequest
// UpdateUserStatusJSONBody defines parameters for UpdateUserStatus.
type UpdateUserStatusJSONBody UserStatusUpdate
// CreateClaimRequestBody defines body for CreateClaim for application/json ContentType.
type CreateClaimJSONRequestBody CreateClaimJSONBody
// UpdateClaimRequestBody defines body for UpdateClaim for application/json ContentType.
type UpdateClaimJSONRequestBody UpdateClaimJSONBody
// CreateScopeRequestBody defines body for CreateScope for application/json ContentType.
type CreateScopeJSONRequestBody CreateScopeJSONBody
// UpdateScopeRequestBody defines body for UpdateScope for application/json ContentType.
type UpdateScopeJSONRequestBody UpdateScopeJSONBody
// CreateSecretChannelRequestBody defines body for CreateSecretChannel for application/json ContentType.
type CreateSecretChannelJSONRequestBody CreateSecretChannelJSONBody
// UpdateSecretChannelRequestBody defines body for UpdateSecretChannel for application/json ContentType.
type UpdateSecretChannelJSONRequestBody UpdateSecretChannelJSONBody
// CreateServiceProviderRequestBody defines body for CreateServiceProvider for application/json ContentType.
type CreateServiceProviderJSONRequestBody CreateServiceProviderJSONBody
// PatchServiceProviderRequestBody defines body for PatchServiceProvider for application/json ContentType.
type PatchServiceProviderJSONRequestBody PatchServiceProviderJSONBody
// UpdateServiceProviderRequestBody defines body for UpdateServiceProvider for application/json ContentType.
type UpdateServiceProviderJSONRequestBody UpdateServiceProviderJSONBody
// CreateUserRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserJSONRequestBody CreateUserJSONBody
// InitiatePasswordRecoveryRequestBody defines body for InitiatePasswordRecovery for application/json ContentType.
type InitiatePasswordRecoveryJSONRequestBody InitiatePasswordRecoveryJSONBody
// ResetUserPasswordRequestBody defines body for ResetUserPassword for application/json ContentType.
type ResetUserPasswordJSONRequestBody ResetUserPasswordJSONBody
// UpdateUserRequestBody defines body for UpdateUser for application/json ContentType.
type UpdateUserJSONRequestBody UpdateUserJSONBody
// ChangeUserPasswordRequestBody defines body for ChangeUserPassword for application/json ContentType.
type ChangeUserPasswordJSONRequestBody ChangeUserPasswordJSONBody
// UpdateUserStatusRequestBody defines body for UpdateUserStatus for application/json ContentType.
type UpdateUserStatusJSONRequestBody UpdateUserStatusJSONBody
// ServerInterface represents all server handlers.
type ServerInterface interface {
// List All claims
// (GET /v1/api/claims)
GetClaims(ctx echo.Context, params GetClaimsParams) error
// Create a Claim
// (POST /v1/api/claims)
CreateClaim(ctx echo.Context) error
// find claim by name
// (GET /v1/api/claims/find)
FindClaimByName(ctx echo.Context, params FindClaimByNameParams) error
// Delete a Claim
// (DELETE /v1/api/claims/{id})
DeleteClaim(ctx echo.Context, id int) error
// Get a Claim
// (GET /v1/api/claims/{id})
GetClaim(ctx echo.Context, id int) error
// Update a Claim
// (PUT /v1/api/claims/{id})
UpdateClaim(ctx echo.Context, id int) error
// List All scopes
// (GET /v1/api/scopes)
GetScopes(ctx echo.Context, params GetScopesParams) error
// Create a Scope
// (POST /v1/api/scopes)
CreateScope(ctx echo.Context) error
// Used to find a scope with name
// (GET /v1/api/scopes/find)
FindScopeByName(ctx echo.Context, params FindScopeByNameParams) error
// Delete a Scope
// (DELETE /v1/api/scopes/{id})
DeleteScope(ctx echo.Context, id int) error
// Get a Scope
// (GET /v1/api/scopes/{id})
GetScope(ctx echo.Context, id int) error
// Update a Scope
// (PUT /v1/api/scopes/{id})
UpdateScope(ctx echo.Context, id int) error
// Remove one claim from scope
// (DELETE /v1/api/scopes/{id}/claim/{claimId})
RemoveClaimFromScope(ctx echo.Context, id int, claimId int) error
// Add one claim to scope
// (PUT /v1/api/scopes/{id}/claim/{claimId})
AddClaimToScope(ctx echo.Context, id int, claimId int) error
// List All secretchannels
// (GET /v1/api/secretchannels)
GetSecretChannels(ctx echo.Context, params GetSecretChannelsParams) error
// Create a SecretChannel
// (POST /v1/api/secretchannels)
CreateSecretChannel(ctx echo.Context) error
// Find secret channel by algo and use
// (GET /v1/api/secretchannels/find/algouse)
FindSecretChannelByAlgouse(ctx echo.Context, params FindSecretChannelByAlgouseParams) error
// Fins secret by name
// (GET /v1/api/secretchannels/find/name)
FindSecretChannelByName(ctx echo.Context, params FindSecretChannelByNameParams) error
// Delete a SecretChannel
// (DELETE /v1/api/secretchannels/{id})
DeleteSecretChannel(ctx echo.Context, id string) error
// Get a SecretChannel
// (GET /v1/api/secretchannels/{id})
GetSecretChannel(ctx echo.Context, id string) error
// Renew the secret of the channel
// (POST /v1/api/secretchannels/{id})
RenewSecretChannel(ctx echo.Context, id string) error
// Update a SecretChannel
// (PUT /v1/api/secretchannels/{id})
UpdateSecretChannel(ctx echo.Context, id string) error
// List All serviceproviders
// (GET /v1/api/serviceproviders)
GetServiceProviders(ctx echo.Context, params GetServiceProvidersParams) error
// Create a ServiceProvider
// (POST /v1/api/serviceproviders)
CreateServiceProvider(ctx echo.Context) error
// find sp by client id or name
// (GET /v1/api/serviceproviders/find)
FindServiceProvider(ctx echo.Context, params FindServiceProviderParams) error
// Delete a ServiceProvider
// (DELETE /v1/api/serviceproviders/{id})
DeleteServiceProvider(ctx echo.Context, id int) error
// Get a ServiceProvider
// (GET /v1/api/serviceproviders/{id})
GetServiceProvider(ctx echo.Context, id int) error
// Patch service provider
// (PATCH /v1/api/serviceproviders/{id})
PatchServiceProvider(ctx echo.Context, id int) error
// Update a ServiceProvider
// (PUT /v1/api/serviceproviders/{id})
UpdateServiceProvider(ctx echo.Context, id int) error
// deactivate service provider
// (DELETE /v1/api/serviceproviders/{id}/activate)
DeactivateServiceProvider(ctx echo.Context, id int) error
// Activate a service provider
// (POST /v1/api/serviceproviders/{id}/activate)
ActivateServiceProvider(ctx echo.Context, id int) error
// Retrieves the existing credentials
// (GET /v1/api/serviceproviders/{id}/credentials)
GetCredentials(ctx echo.Context, id int) error
// Update a Client
// (PUT /v1/api/serviceproviders/{id}/credentials)
GenerateCredentials(ctx echo.Context, id int, params GenerateCredentialsParams) error
// List All users
// (GET /v1/api/users)
GetUsers(ctx echo.Context, params GetUsersParams) error
// Create a User
// (POST /v1/api/users)
CreateUser(ctx echo.Context) error
// find user by username or email id
// (GET /v1/api/users/find)
FindUser(ctx echo.Context, params FindUserParams) error
// Initiate Password Recovery
// (POST /v1/api/users/recover/password)
InitiatePasswordRecovery(ctx echo.Context) error
// Reset password, after recovery
// (PUT /v1/api/users/recover/password)
ResetUserPassword(ctx echo.Context) error
// Delete a User
// (DELETE /v1/api/users/{id})
DeleteUser(ctx echo.Context, id int) error
// Get a User
// (GET /v1/api/users/{id})
GetUser(ctx echo.Context, id int) error
// Update a User
// (PUT /v1/api/users/{id})
UpdateUser(ctx echo.Context, id int) error
// Change Password
// (POST /v1/api/users/{id}/password)
ChangeUserPassword(ctx echo.Context, id int) error
// Update status
// (POST /v1/api/users/{id}/status)
UpdateUserStatus(ctx echo.Context, id int) error
}
// ServerInterfaceWrapper converts echo contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
// GetClaims converts echo context to params.
func (w *ServerInterfaceWrapper) GetClaims(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params GetClaimsParams
// ------------- Optional query parameter "page_size" -------------
err = runtime.BindQueryParameter("form", true, false, "page_size", ctx.QueryParams(), ¶ms.PageSize)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page_size: %s", err))
}
// ------------- Optional query parameter "page_number" -------------
err = runtime.BindQueryParameter("form", true, false, "page_number", ctx.QueryParams(), ¶ms.PageNumber)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page_number: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetClaims(ctx, params)
return err
}
// CreateClaim converts echo context to params.
func (w *ServerInterfaceWrapper) CreateClaim(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CreateClaim(ctx)
return err
}
// FindClaimByName converts echo context to params.
func (w *ServerInterfaceWrapper) FindClaimByName(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params FindClaimByNameParams
// ------------- Required query parameter "name" -------------
err = runtime.BindQueryParameter("form", true, true, "name", ctx.QueryParams(), ¶ms.Name)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FindClaimByName(ctx, params)
return err
}
// DeleteClaim converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteClaim(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id int
err = runtime.BindStyledParameter("simple", false, "id", ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteClaim(ctx, id)
return err
}
// GetClaim converts echo context to params.
func (w *ServerInterfaceWrapper) GetClaim(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id int
err = runtime.BindStyledParameter("simple", false, "id", ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetClaim(ctx, id)
return err
}
// UpdateClaim converts echo context to params.
func (w *ServerInterfaceWrapper) UpdateClaim(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id int
err = runtime.BindStyledParameter("simple", false, "id", ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.UpdateClaim(ctx, id)
return err
}
// GetScopes converts echo context to params.
func (w *ServerInterfaceWrapper) GetScopes(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params GetScopesParams
// ------------- Optional query parameter "page_size" -------------
err = runtime.BindQueryParameter("form", true, false, "page_size", ctx.QueryParams(), ¶ms.PageSize)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page_size: %s", err))
}
// ------------- Optional query parameter "page_number" -------------
err = runtime.BindQueryParameter("form", true, false, "page_number", ctx.QueryParams(), ¶ms.PageNumber)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page_number: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetScopes(ctx, params)
return err
}
// CreateScope converts echo context to params.
func (w *ServerInterfaceWrapper) CreateScope(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.CreateScope(ctx)
return err
}
// FindScopeByName converts echo context to params.
func (w *ServerInterfaceWrapper) FindScopeByName(ctx echo.Context) error {
var err error
ctx.Set("OAuth.Scopes", []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params FindScopeByNameParams
// ------------- Required query parameter "name" -------------
err = runtime.BindQueryParameter("form", true, true, "name", ctx.QueryParams(), ¶ms.Name)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err))
}
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.FindScopeByName(ctx, params)
return err
}
// DeleteScope converts echo context to params.
func (w *ServerInterfaceWrapper) DeleteScope(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id int
err = runtime.BindStyledParameter("simple", false, "id", ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.DeleteScope(ctx, id)
return err
}
// GetScope converts echo context to params.
func (w *ServerInterfaceWrapper) GetScope(ctx echo.Context) error {
var err error
// ------------- Path parameter "id" -------------
var id int
err = runtime.BindStyledParameter("simple", false, "id", ctx.Param("id"), &id)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
}
ctx.Set("OAuth.Scopes", []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.GetScope(ctx, id)