forked from ory/hydra-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_admin.go
4988 lines (4309 loc) · 185 KB
/
api_admin.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
/*
* Ory Hydra API
*
* Documentation for all of Ory Hydra's APIs.
*
* API version: v1.11.8
* Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"bytes"
"context"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type AdminApi interface {
/*
* AcceptConsentRequest Accept a Consent Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens, and if the
consent request should be used as basis for future requests.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptConsentRequestRequest
*/
AcceptConsentRequest(ctx context.Context) AdminApiApiAcceptConsentRequestRequest
/*
* AcceptConsentRequestExecute executes the request
* @return CompletedRequest
*/
AcceptConsentRequestExecute(r AdminApiApiAcceptConsentRequestRequest) (*CompletedRequest, *http.Response, error)
/*
* AcceptLoginRequest Accept a Login Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as
the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting
a cookie.
The response contains a redirect URL which the login provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptLoginRequestRequest
*/
AcceptLoginRequest(ctx context.Context) AdminApiApiAcceptLoginRequestRequest
/*
* AcceptLoginRequestExecute executes the request
* @return CompletedRequest
*/
AcceptLoginRequestExecute(r AdminApiApiAcceptLoginRequestRequest) (*CompletedRequest, *http.Response, error)
/*
* AcceptLogoutRequest Accept a Logout Request
* When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request.
No body is required.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptLogoutRequestRequest
*/
AcceptLogoutRequest(ctx context.Context) AdminApiApiAcceptLogoutRequestRequest
/*
* AcceptLogoutRequestExecute executes the request
* @return CompletedRequest
*/
AcceptLogoutRequestExecute(r AdminApiApiAcceptLogoutRequestRequest) (*CompletedRequest, *http.Response, error)
/*
* CreateJsonWebKeySet Generate a New JSON Web Key
* This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param set The set
* @return AdminApiApiCreateJsonWebKeySetRequest
*/
CreateJsonWebKeySet(ctx context.Context, set string) AdminApiApiCreateJsonWebKeySetRequest
/*
* CreateJsonWebKeySetExecute executes the request
* @return JSONWebKeySet
*/
CreateJsonWebKeySetExecute(r AdminApiApiCreateJsonWebKeySetRequest) (*JSONWebKeySet, *http.Response, error)
/*
* CreateOAuth2Client Create an OAuth 2.0 Client
* Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret
will be generated. The secret will be returned in the response and you will not be able to retrieve it later on.
Write the secret down and keep it somwhere safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiCreateOAuth2ClientRequest
*/
CreateOAuth2Client(ctx context.Context) AdminApiApiCreateOAuth2ClientRequest
/*
* CreateOAuth2ClientExecute executes the request
* @return OAuth2Client
*/
CreateOAuth2ClientExecute(r AdminApiApiCreateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error)
/*
* DeleteJsonWebKey Delete a JSON Web Key
* Use this endpoint to delete a single JSON Web Key.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param kid The kid of the desired key
* @param set The set
* @return AdminApiApiDeleteJsonWebKeyRequest
*/
DeleteJsonWebKey(ctx context.Context, kid string, set string) AdminApiApiDeleteJsonWebKeyRequest
/*
* DeleteJsonWebKeyExecute executes the request
*/
DeleteJsonWebKeyExecute(r AdminApiApiDeleteJsonWebKeyRequest) (*http.Response, error)
/*
* DeleteJsonWebKeySet Delete a JSON Web Key Set
* Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param set The set
* @return AdminApiApiDeleteJsonWebKeySetRequest
*/
DeleteJsonWebKeySet(ctx context.Context, set string) AdminApiApiDeleteJsonWebKeySetRequest
/*
* DeleteJsonWebKeySetExecute executes the request
*/
DeleteJsonWebKeySetExecute(r AdminApiApiDeleteJsonWebKeySetRequest) (*http.Response, error)
/*
* DeleteOAuth2Client Deletes an OAuth 2.0 Client
* Delete an existing OAuth 2.0 Client by its ID.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
Make sure that this endpoint is well protected and only callable by first-party components.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the OAuth 2.0 Client.
* @return AdminApiApiDeleteOAuth2ClientRequest
*/
DeleteOAuth2Client(ctx context.Context, id string) AdminApiApiDeleteOAuth2ClientRequest
/*
* DeleteOAuth2ClientExecute executes the request
*/
DeleteOAuth2ClientExecute(r AdminApiApiDeleteOAuth2ClientRequest) (*http.Response, error)
/*
* DeleteOAuth2Token Delete OAuth2 Access Tokens from a Client
* This endpoint deletes OAuth2 access tokens issued for a client from the database
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiDeleteOAuth2TokenRequest
*/
DeleteOAuth2Token(ctx context.Context) AdminApiApiDeleteOAuth2TokenRequest
/*
* DeleteOAuth2TokenExecute executes the request
*/
DeleteOAuth2TokenExecute(r AdminApiApiDeleteOAuth2TokenRequest) (*http.Response, error)
/*
* DeleteTrustedJwtGrantIssuer Delete a Trusted OAuth2 JWT Bearer Grant Type Issuer
* Use this endpoint to delete trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
created the trust relationship.
Once deleted, the associated issuer will no longer be able to perform the JSON Web Token (JWT) Profile
for OAuth 2.0 Client Authentication and Authorization Grant.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the desired grant
* @return AdminApiApiDeleteTrustedJwtGrantIssuerRequest
*/
DeleteTrustedJwtGrantIssuer(ctx context.Context, id string) AdminApiApiDeleteTrustedJwtGrantIssuerRequest
/*
* DeleteTrustedJwtGrantIssuerExecute executes the request
*/
DeleteTrustedJwtGrantIssuerExecute(r AdminApiApiDeleteTrustedJwtGrantIssuerRequest) (*http.Response, error)
/*
* FlushInactiveOAuth2Tokens Flush Expired OAuth2 Access Tokens
* This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which no tokens will be
not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted
automatically when performing the refresh flow.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiFlushInactiveOAuth2TokensRequest
*/
FlushInactiveOAuth2Tokens(ctx context.Context) AdminApiApiFlushInactiveOAuth2TokensRequest
/*
* FlushInactiveOAuth2TokensExecute executes the request
*/
FlushInactiveOAuth2TokensExecute(r AdminApiApiFlushInactiveOAuth2TokensRequest) (*http.Response, error)
/*
* GetConsentRequest Get Consent Request Information
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiGetConsentRequestRequest
*/
GetConsentRequest(ctx context.Context) AdminApiApiGetConsentRequestRequest
/*
* GetConsentRequestExecute executes the request
* @return ConsentRequest
*/
GetConsentRequestExecute(r AdminApiApiGetConsentRequestRequest) (*ConsentRequest, *http.Response, error)
/*
* GetJsonWebKey Fetch a JSON Web Key
* This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param kid The kid of the desired key
* @param set The set
* @return AdminApiApiGetJsonWebKeyRequest
*/
GetJsonWebKey(ctx context.Context, kid string, set string) AdminApiApiGetJsonWebKeyRequest
/*
* GetJsonWebKeyExecute executes the request
* @return JSONWebKeySet
*/
GetJsonWebKeyExecute(r AdminApiApiGetJsonWebKeyRequest) (*JSONWebKeySet, *http.Response, error)
/*
* GetJsonWebKeySet Retrieve a JSON Web Key Set
* This endpoint can be used to retrieve JWK Sets stored in ORY Hydra.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param set The set
* @return AdminApiApiGetJsonWebKeySetRequest
*/
GetJsonWebKeySet(ctx context.Context, set string) AdminApiApiGetJsonWebKeySetRequest
/*
* GetJsonWebKeySetExecute executes the request
* @return JSONWebKeySet
*/
GetJsonWebKeySetExecute(r AdminApiApiGetJsonWebKeySetRequest) (*JSONWebKeySet, *http.Response, error)
/*
* GetLoginRequest Get a Login Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiGetLoginRequestRequest
*/
GetLoginRequest(ctx context.Context) AdminApiApiGetLoginRequestRequest
/*
* GetLoginRequestExecute executes the request
* @return LoginRequest
*/
GetLoginRequestExecute(r AdminApiApiGetLoginRequestRequest) (*LoginRequest, *http.Response, error)
/*
* GetLogoutRequest Get a Logout Request
* Use this endpoint to fetch a logout request.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiGetLogoutRequestRequest
*/
GetLogoutRequest(ctx context.Context) AdminApiApiGetLogoutRequestRequest
/*
* GetLogoutRequestExecute executes the request
* @return LogoutRequest
*/
GetLogoutRequestExecute(r AdminApiApiGetLogoutRequestRequest) (*LogoutRequest, *http.Response, error)
/*
* GetOAuth2Client Get an OAuth 2.0 Client
* Get an OAuth 2.0 client by its ID. This endpoint never returns the client secret.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the OAuth 2.0 Client.
* @return AdminApiApiGetOAuth2ClientRequest
*/
GetOAuth2Client(ctx context.Context, id string) AdminApiApiGetOAuth2ClientRequest
/*
* GetOAuth2ClientExecute executes the request
* @return OAuth2Client
*/
GetOAuth2ClientExecute(r AdminApiApiGetOAuth2ClientRequest) (*OAuth2Client, *http.Response, error)
/*
* GetTrustedJwtGrantIssuer Get a Trusted OAuth2 JWT Bearer Grant Type Issuer
* Use this endpoint to get a trusted JWT Bearer Grant Type Issuer. The ID is the one returned when you
created the trust relationship.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the desired grant
* @return AdminApiApiGetTrustedJwtGrantIssuerRequest
*/
GetTrustedJwtGrantIssuer(ctx context.Context, id string) AdminApiApiGetTrustedJwtGrantIssuerRequest
/*
* GetTrustedJwtGrantIssuerExecute executes the request
* @return TrustedJwtGrantIssuer
*/
GetTrustedJwtGrantIssuerExecute(r AdminApiApiGetTrustedJwtGrantIssuerRequest) (*TrustedJwtGrantIssuer, *http.Response, error)
/*
* IntrospectOAuth2Token Introspect OAuth2 Tokens
* The introspection endpoint allows to check if a token (both refresh and access) is active or not. An active token
is neither expired nor revoked. If a token is active, additional information on the token will be included. You can
set additional data for a token by setting `accessTokenExtra` during the consent flow.
For more information [read this blog post](https://www.oauth.com/oauth2-servers/token-introspection-endpoint/).
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiIntrospectOAuth2TokenRequest
*/
IntrospectOAuth2Token(ctx context.Context) AdminApiApiIntrospectOAuth2TokenRequest
/*
* IntrospectOAuth2TokenExecute executes the request
* @return OAuth2TokenIntrospection
*/
IntrospectOAuth2TokenExecute(r AdminApiApiIntrospectOAuth2TokenRequest) (*OAuth2TokenIntrospection, *http.Response, error)
/*
* ListOAuth2Clients List OAuth 2.0 Clients
* This endpoint lists all clients in the database, and never returns client secrets.
As a default it lists the first 100 clients. The `limit` parameter can be used to retrieve more clients,
but it has an upper bound at 500 objects. Pagination should be used to retrieve more than 500 objects.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://hydra-url/admin/clients?limit={limit}&offset={offset}>; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.
Multiple links can be included in this header, and will be separated by a comma.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiListOAuth2ClientsRequest
*/
ListOAuth2Clients(ctx context.Context) AdminApiApiListOAuth2ClientsRequest
/*
* ListOAuth2ClientsExecute executes the request
* @return []OAuth2Client
*/
ListOAuth2ClientsExecute(r AdminApiApiListOAuth2ClientsRequest) ([]OAuth2Client, *http.Response, error)
/*
* ListSubjectConsentSessions Lists All Consent Sessions of a Subject
* This endpoint lists all subject's granted consent sessions, including client and granted scope.
If the subject is unknown or has not granted any consent sessions yet, the endpoint returns an
empty JSON array with status code 200 OK.
The "Link" header is also included in successful responses, which contains one or more links for pagination, formatted like so: '<https://hydra-url/admin/oauth2/auth/sessions/consent?subject={user}&limit={limit}&offset={offset}>; rel="{page}"', where page is one of the following applicable pages: 'first', 'next', 'last', and 'previous'.
Multiple links can be included in this header, and will be separated by a comma.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiListSubjectConsentSessionsRequest
*/
ListSubjectConsentSessions(ctx context.Context) AdminApiApiListSubjectConsentSessionsRequest
/*
* ListSubjectConsentSessionsExecute executes the request
* @return []PreviousConsentSession
*/
ListSubjectConsentSessionsExecute(r AdminApiApiListSubjectConsentSessionsRequest) ([]PreviousConsentSession, *http.Response, error)
/*
* ListTrustedJwtGrantIssuers List Trusted OAuth2 JWT Bearer Grant Type Issuers
* Use this endpoint to list all trusted JWT Bearer Grant Type Issuers.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiListTrustedJwtGrantIssuersRequest
*/
ListTrustedJwtGrantIssuers(ctx context.Context) AdminApiApiListTrustedJwtGrantIssuersRequest
/*
* ListTrustedJwtGrantIssuersExecute executes the request
* @return []TrustedJwtGrantIssuer
*/
ListTrustedJwtGrantIssuersExecute(r AdminApiApiListTrustedJwtGrantIssuersRequest) ([]TrustedJwtGrantIssuer, *http.Response, error)
/*
* PatchOAuth2Client Patch an OAuth 2.0 Client
* Patch an existing OAuth 2.0 Client. If you pass `client_secret`
the secret will be updated and returned via the API. This is the
only time you will be able to retrieve the client secret, so write it down and keep it safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the OAuth 2.0 Client.
* @return AdminApiApiPatchOAuth2ClientRequest
*/
PatchOAuth2Client(ctx context.Context, id string) AdminApiApiPatchOAuth2ClientRequest
/*
* PatchOAuth2ClientExecute executes the request
* @return OAuth2Client
*/
PatchOAuth2ClientExecute(r AdminApiApiPatchOAuth2ClientRequest) (*OAuth2Client, *http.Response, error)
/*
* RejectConsentRequest Reject a Consent Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
This endpoint tells ORY Hydra that the subject has not authorized the OAuth 2.0 client to access resources on his/her behalf.
The consent provider must include a reason why the consent was not granted.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiRejectConsentRequestRequest
*/
RejectConsentRequest(ctx context.Context) AdminApiApiRejectConsentRequestRequest
/*
* RejectConsentRequestExecute executes the request
* @return CompletedRequest
*/
RejectConsentRequestExecute(r AdminApiApiRejectConsentRequestRequest) (*CompletedRequest, *http.Response, error)
/*
* RejectLoginRequest Reject a Login Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
This endpoint tells ORY Hydra that the subject has not authenticated and includes a reason why the authentication
was be denied.
The response contains a redirect URL which the login provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiRejectLoginRequestRequest
*/
RejectLoginRequest(ctx context.Context) AdminApiApiRejectLoginRequestRequest
/*
* RejectLoginRequestExecute executes the request
* @return CompletedRequest
*/
RejectLoginRequestExecute(r AdminApiApiRejectLoginRequestRequest) (*CompletedRequest, *http.Response, error)
/*
* RejectLogoutRequest Reject a Logout Request
* When a user or an application requests ORY Hydra to log out a user, this endpoint is used to deny that logout request.
No body is required.
The response is empty as the logout provider has to chose what action to perform next.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiRejectLogoutRequestRequest
*/
RejectLogoutRequest(ctx context.Context) AdminApiApiRejectLogoutRequestRequest
/*
* RejectLogoutRequestExecute executes the request
*/
RejectLogoutRequestExecute(r AdminApiApiRejectLogoutRequestRequest) (*http.Response, error)
/*
* RevokeAuthenticationSession Invalidates All Login Sessions of a Certain User Invalidates a Subject's Authentication Session
* This endpoint invalidates a subject's authentication session. After revoking the authentication session, the subject
has to re-authenticate at ORY Hydra. This endpoint does not invalidate any tokens and does not work with OpenID Connect
Front- or Back-channel logout.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiRevokeAuthenticationSessionRequest
*/
RevokeAuthenticationSession(ctx context.Context) AdminApiApiRevokeAuthenticationSessionRequest
/*
* RevokeAuthenticationSessionExecute executes the request
*/
RevokeAuthenticationSessionExecute(r AdminApiApiRevokeAuthenticationSessionRequest) (*http.Response, error)
/*
* RevokeConsentSessions Revokes Consent Sessions of a Subject for a Specific OAuth 2.0 Client
* This endpoint revokes a subject's granted consent sessions for a specific OAuth 2.0 Client and invalidates all
associated OAuth 2.0 Access Tokens.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiRevokeConsentSessionsRequest
*/
RevokeConsentSessions(ctx context.Context) AdminApiApiRevokeConsentSessionsRequest
/*
* RevokeConsentSessionsExecute executes the request
*/
RevokeConsentSessionsExecute(r AdminApiApiRevokeConsentSessionsRequest) (*http.Response, error)
/*
* TrustJwtGrantIssuer Trust an OAuth2 JWT Bearer Grant Type Issuer
* Use this endpoint to establish a trust relationship for a JWT issuer
to perform JSON Web Token (JWT) Profile for OAuth 2.0 Client Authentication
and Authorization Grants [RFC7523](https://datatracker.ietf.org/doc/html/rfc7523).
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiTrustJwtGrantIssuerRequest
*/
TrustJwtGrantIssuer(ctx context.Context) AdminApiApiTrustJwtGrantIssuerRequest
/*
* TrustJwtGrantIssuerExecute executes the request
* @return TrustedJwtGrantIssuer
*/
TrustJwtGrantIssuerExecute(r AdminApiApiTrustJwtGrantIssuerRequest) (*TrustedJwtGrantIssuer, *http.Response, error)
/*
* UpdateJsonWebKey Update a JSON Web Key
* Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param kid The kid of the desired key
* @param set The set
* @return AdminApiApiUpdateJsonWebKeyRequest
*/
UpdateJsonWebKey(ctx context.Context, kid string, set string) AdminApiApiUpdateJsonWebKeyRequest
/*
* UpdateJsonWebKeyExecute executes the request
* @return JSONWebKey
*/
UpdateJsonWebKeyExecute(r AdminApiApiUpdateJsonWebKeyRequest) (*JSONWebKey, *http.Response, error)
/*
* UpdateJsonWebKeySet Update a JSON Web Key Set
* Use this method if you do not want to let Hydra generate the JWKs for you, but instead save your own.
A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param set The set
* @return AdminApiApiUpdateJsonWebKeySetRequest
*/
UpdateJsonWebKeySet(ctx context.Context, set string) AdminApiApiUpdateJsonWebKeySetRequest
/*
* UpdateJsonWebKeySetExecute executes the request
* @return JSONWebKeySet
*/
UpdateJsonWebKeySetExecute(r AdminApiApiUpdateJsonWebKeySetRequest) (*JSONWebKeySet, *http.Response, error)
/*
* UpdateOAuth2Client Update an OAuth 2.0 Client
* Update an existing OAuth 2.0 Client. If you pass `client_secret` the secret will be updated and returned via the API.
This is the only time you will be able to retrieve the client secret, so write it down and keep it safe.
OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are
generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The id of the OAuth 2.0 Client.
* @return AdminApiApiUpdateOAuth2ClientRequest
*/
UpdateOAuth2Client(ctx context.Context, id string) AdminApiApiUpdateOAuth2ClientRequest
/*
* UpdateOAuth2ClientExecute executes the request
* @return OAuth2Client
*/
UpdateOAuth2ClientExecute(r AdminApiApiUpdateOAuth2ClientRequest) (*OAuth2Client, *http.Response, error)
}
// AdminApiService AdminApi service
type AdminApiService service
type AdminApiApiAcceptConsentRequestRequest struct {
ctx context.Context
ApiService AdminApi
consentChallenge *string
acceptConsentRequest *AcceptConsentRequest
}
func (r AdminApiApiAcceptConsentRequestRequest) ConsentChallenge(consentChallenge string) AdminApiApiAcceptConsentRequestRequest {
r.consentChallenge = &consentChallenge
return r
}
func (r AdminApiApiAcceptConsentRequestRequest) AcceptConsentRequest(acceptConsentRequest AcceptConsentRequest) AdminApiApiAcceptConsentRequestRequest {
r.acceptConsentRequest = &acceptConsentRequest
return r
}
func (r AdminApiApiAcceptConsentRequestRequest) Execute() (*CompletedRequest, *http.Response, error) {
return r.ApiService.AcceptConsentRequestExecute(r)
}
/*
* AcceptConsentRequest Accept a Consent Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if
the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject's behalf.
The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to
grant or deny the client access to the requested scope ("Application my-dropbox-app wants write access to all your private files").
The consent challenge is appended to the consent provider's URL to which the subject's user-agent (browser) is redirected to. The consent
provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted
or rejected the request.
This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf.
The consent provider includes additional information, such as session data for access and ID tokens, and if the
consent request should be used as basis for future requests.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptConsentRequestRequest
*/
func (a *AdminApiService) AcceptConsentRequest(ctx context.Context) AdminApiApiAcceptConsentRequestRequest {
return AdminApiApiAcceptConsentRequestRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return CompletedRequest
*/
func (a *AdminApiService) AcceptConsentRequestExecute(r AdminApiApiAcceptConsentRequestRequest) (*CompletedRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *CompletedRequest
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AcceptConsentRequest")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/oauth2/auth/requests/consent/accept"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.consentChallenge == nil {
return localVarReturnValue, nil, reportError("consentChallenge is required and must be specified")
}
localVarQueryParams.Add("consent_challenge", parameterToString(*r.consentChallenge, ""))
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.acceptConsentRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 404 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type AdminApiApiAcceptLoginRequestRequest struct {
ctx context.Context
ApiService AdminApi
loginChallenge *string
acceptLoginRequest *AcceptLoginRequest
}
func (r AdminApiApiAcceptLoginRequestRequest) LoginChallenge(loginChallenge string) AdminApiApiAcceptLoginRequestRequest {
r.loginChallenge = &loginChallenge
return r
}
func (r AdminApiApiAcceptLoginRequestRequest) AcceptLoginRequest(acceptLoginRequest AcceptLoginRequest) AdminApiApiAcceptLoginRequestRequest {
r.acceptLoginRequest = &acceptLoginRequest
return r
}
func (r AdminApiApiAcceptLoginRequestRequest) Execute() (*CompletedRequest, *http.Response, error) {
return r.ApiService.AcceptLoginRequestExecute(r)
}
/*
* AcceptLoginRequest Accept a Login Request
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider
(sometimes called "identity provider") to authenticate the subject and then tell ORY Hydra now about it. The login
provider is an web-app you write and host, and it must be able to authenticate ("show the subject a login screen")
a subject (in OAuth2 the proper name for subject is "resource owner").
The authentication challenge is appended to the login provider URL to which the subject's user-agent (browser) is redirected to. The login
provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as
the subject's ID and if ORY Hydra should remember the subject's subject agent for future authentication attempts by setting
a cookie.
The response contains a redirect URL which the login provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptLoginRequestRequest
*/
func (a *AdminApiService) AcceptLoginRequest(ctx context.Context) AdminApiApiAcceptLoginRequestRequest {
return AdminApiApiAcceptLoginRequestRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return CompletedRequest
*/
func (a *AdminApiService) AcceptLoginRequestExecute(r AdminApiApiAcceptLoginRequestRequest) (*CompletedRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *CompletedRequest
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AcceptLoginRequest")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/oauth2/auth/requests/login/accept"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.loginChallenge == nil {
return localVarReturnValue, nil, reportError("loginChallenge is required and must be specified")
}
localVarQueryParams.Add("login_challenge", parameterToString(*r.loginChallenge, ""))
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.acceptLoginRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v JsonError
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type AdminApiApiAcceptLogoutRequestRequest struct {
ctx context.Context
ApiService AdminApi
logoutChallenge *string
}
func (r AdminApiApiAcceptLogoutRequestRequest) LogoutChallenge(logoutChallenge string) AdminApiApiAcceptLogoutRequestRequest {
r.logoutChallenge = &logoutChallenge
return r
}
func (r AdminApiApiAcceptLogoutRequestRequest) Execute() (*CompletedRequest, *http.Response, error) {
return r.ApiService.AcceptLogoutRequestExecute(r)
}
/*
* AcceptLogoutRequest Accept a Logout Request
* When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request.
No body is required.
The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @return AdminApiApiAcceptLogoutRequestRequest
*/
func (a *AdminApiService) AcceptLogoutRequest(ctx context.Context) AdminApiApiAcceptLogoutRequestRequest {
return AdminApiApiAcceptLogoutRequestRequest{
ApiService: a,
ctx: ctx,
}
}
/*
* Execute executes the request
* @return CompletedRequest
*/
func (a *AdminApiService) AcceptLogoutRequestExecute(r AdminApiApiAcceptLogoutRequestRequest) (*CompletedRequest, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPut
localVarPostBody interface{}
localVarFormFileName string
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *CompletedRequest
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AcceptLogoutRequest")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/oauth2/auth/requests/logout/accept"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}