Skip to content

Commit

Permalink
Rename HandledConsentRequestResponse to PreviousConsentSession
Browse files Browse the repository at this point in the history
Signed-off-by: Jan <king-jan1999@hotmail.de>
  • Loading branch information
kingjan1999 committed Aug 2, 2018
1 parent 701e490 commit 5234a6d
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 87 deletions.
2 changes: 1 addition & 1 deletion consent/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ type swaggerRejectRequest struct {
type swaggerListHandledConsentRequestsResult struct {
// in: body
// type: array
Body []HandledConsentRequestResponse
Body []PreviousConsentSession
}
6 changes: 3 additions & 3 deletions consent/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ func (h *Handler) GetConsentSessions(w http.ResponseWriter, r *http.Request, ps
return
}

var a []HandledConsentRequestResponse
var a []PreviousConsentSession

for _, session := range sessions {
session.ConsentRequest.Client = sanitizeClient(session.ConsentRequest.Client)
a = append(a, HandledConsentRequestResponse(session))
a = append(a, PreviousConsentSession(session))
}

if len(a) == 0 {
a = []HandledConsentRequestResponse{}
a = []PreviousConsentSession{}
}

h.H.Write(w, r, a)
Expand Down
2 changes: 1 addition & 1 deletion consent/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type HandledConsentRequest struct {

// The response used to return handled consent requests
// same as HandledAuthenticationRequest, just with consent_request exposed as json
type HandledConsentRequestResponse struct {
type PreviousConsentSession struct {
// GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`
GrantedScope []string `json:"grant_scope"`

Expand Down
66 changes: 33 additions & 33 deletions docs/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1770,38 +1770,6 @@
},
"x-go-package": "crypto/x509/pkix"
},
"HandledConsentRequestResponse": {
"description": "The response used to return handled consent requests\nsame as HandledAuthenticationRequest, just with consent_request exposed as json",
"type": "object",
"properties": {
"consent_request": {
"$ref": "#/definitions/consentRequest"
},
"grant_scope": {
"description": "GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "GrantedScope"
},
"remember": {
"description": "Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same\nclient asks the same user for the same, or a subset of, scope.",
"type": "boolean",
"x-go-name": "Remember"
},
"remember_for": {
"description": "RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the\nauthorization will be remembered indefinitely.",
"type": "integer",
"format": "int64",
"x-go-name": "RememberFor"
},
"session": {
"$ref": "#/definitions/consentRequestSession"
}
},
"x-go-package": "github.com/ory/hydra/consent"
},
"IP": {
"description": "Note that in this documentation, referring to an\nIP address as an IPv4 address or an IPv6 address\nis a semantic property of the address, not just the\nlength of the byte slice: a 16-byte slice can still\nbe an IPv4 address.",
"type": "array",
Expand Down Expand Up @@ -1934,6 +1902,38 @@
},
"x-go-package": "encoding/asn1"
},
"PreviousConsentSession": {
"description": "The response used to return handled consent requests\nsame as HandledAuthenticationRequest, just with consent_request exposed as json",
"type": "object",
"properties": {
"consent_request": {
"$ref": "#/definitions/consentRequest"
},
"grant_scope": {
"description": "GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "GrantedScope"
},
"remember": {
"description": "Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same\nclient asks the same user for the same, or a subset of, scope.",
"type": "boolean",
"x-go-name": "Remember"
},
"remember_for": {
"description": "RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the\nauthorization will be remembered indefinitely.",
"type": "integer",
"format": "int64",
"x-go-name": "RememberFor"
},
"session": {
"$ref": "#/definitions/consentRequestSession"
}
},
"x-go-package": "github.com/ory/hydra/consent"
},
"PublicKeyAlgorithm": {
"type": "integer",
"format": "int64",
Expand Down Expand Up @@ -3093,7 +3093,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/HandledConsentRequestResponse"
"$ref": "#/definitions/PreviousConsentSession"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/go/hydra/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Class | Method | HTTP request | Description
- [ExtKeyUsage](docs/ExtKeyUsage.md)
- [Extension](docs/Extension.md)
- [FlushInactiveOAuth2TokensRequest](docs/FlushInactiveOAuth2TokensRequest.md)
- [HandledConsentRequestResponse](docs/HandledConsentRequestResponse.md)
- [HealthNotReadyStatus](docs/HealthNotReadyStatus.md)
- [HealthStatus](docs/HealthStatus.md)
- [InlineResponse401](docs/InlineResponse401.md)
Expand All @@ -91,6 +90,7 @@ Class | Method | HTTP request | Description
- [OauthTokenResponse](docs/OauthTokenResponse.md)
- [ObjectIdentifier](docs/ObjectIdentifier.md)
- [OpenIdConnectContext](docs/OpenIdConnectContext.md)
- [PreviousConsentSession](docs/PreviousConsentSession.md)
- [PublicKeyAlgorithm](docs/PublicKeyAlgorithm.md)
- [RawMessage](docs/RawMessage.md)
- [RejectRequest](docs/RejectRequest.md)
Expand Down
4 changes: 2 additions & 2 deletions sdk/go/hydra/swagger/docs/OAuth2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **ListUserClientConsentSessions**
> []HandledConsentRequestResponse ListUserClientConsentSessions($user)
> []PreviousConsentSession ListUserClientConsentSessions($user)
Lists all consent sessions of a user

Expand All @@ -365,7 +365,7 @@ Name | Type | Description | Notes

### Return type

[**[]HandledConsentRequestResponse**](HandledConsentRequestResponse.md)
[**[]PreviousConsentSession**](PreviousConsentSession.md)

### Authorization

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HandledConsentRequestResponse
# PreviousConsentSession

## Properties
Name | Type | Description | Notes
Expand Down
6 changes: 3 additions & 3 deletions sdk/go/hydra/swagger/o_auth2_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ func (a OAuth2Api) ListOAuth2Clients(limit int64, offset int64) ([]OAuth2Client,
* This endpoint lists all user&#39;s granted consent sessions, including client and granted scope
*
* @param user
* @return []HandledConsentRequestResponse
* @return []PreviousConsentSession
*/
func (a OAuth2Api) ListUserClientConsentSessions(user string) ([]HandledConsentRequestResponse, *APIResponse, error) {
func (a OAuth2Api) ListUserClientConsentSessions(user string) ([]PreviousConsentSession, *APIResponse, error) {

var localVarHttpMethod = strings.ToUpper("Get")
// create path and map variables
Expand Down Expand Up @@ -767,7 +767,7 @@ func (a OAuth2Api) ListUserClientConsentSessions(user string) ([]HandledConsentR
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
var successPayload = new([]HandledConsentRequestResponse)
var successPayload = new([]PreviousConsentSession)
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)

var localVarURL, _ = url.Parse(localVarPath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package swagger

// The response used to return handled consent requests same as HandledAuthenticationRequest, just with consent_request exposed as json
type HandledConsentRequestResponse struct {
type PreviousConsentSession struct {
ConsentRequest ConsentRequest `json:"consent_request,omitempty"`

// GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ Class | Method | HTTP request | Description
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.ExtKeyUsage](docs/ExtKeyUsage.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.Extension](docs/Extension.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.FlushInactiveOAuth2TokensRequest](docs/FlushInactiveOAuth2TokensRequest.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.HandledConsentRequestResponse](docs/HandledConsentRequestResponse.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.HealthNotReadyStatus](docs/HealthNotReadyStatus.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.HealthStatus](docs/HealthStatus.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.IP](docs/IP.md)
Expand All @@ -186,6 +185,7 @@ Class | Method | HTTP request | Description
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.OauthTokenResponse](docs/OauthTokenResponse.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.ObjectIdentifier](docs/ObjectIdentifier.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.OpenIDConnectContext](docs/OpenIDConnectContext.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.PreviousConsentSession](docs/PreviousConsentSession.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.PublicKeyAlgorithm](docs/PublicKeyAlgorithm.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.RawMessage](docs/RawMessage.md)
- [OryHydraCloudNativeOAuth20AndOpenIdConnectServer.RejectRequest](docs/RejectRequest.md)
Expand Down
4 changes: 2 additions & 2 deletions sdk/js/swagger/docs/OAuth2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ No authorization required

<a name="listUserClientConsentSessions"></a>
# **listUserClientConsentSessions**
> [HandledConsentRequestResponse] listUserClientConsentSessions(user)
> [PreviousConsentSession] listUserClientConsentSessions(user)
Lists all consent sessions of a user

Expand Down Expand Up @@ -590,7 +590,7 @@ Name | Type | Description | Notes

### Return type

[**[HandledConsentRequestResponse]**](HandledConsentRequestResponse.md)
[**[PreviousConsentSession]**](PreviousConsentSession.md)

### Authorization

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OryHydraCloudNativeOAuth20AndOpenIdConnectServer.HandledConsentRequestResponse
# OryHydraCloudNativeOAuth20AndOpenIdConnectServer.PreviousConsentSession

## Properties
Name | Type | Description | Notes
Expand Down
16 changes: 8 additions & 8 deletions sdk/js/swagger/src/api/OAuth2Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
'model/CompletedRequest',
'model/ConsentRequest',
'model/FlushInactiveOAuth2TokensRequest',
'model/HandledConsentRequestResponse',
'model/InlineResponse401',
'model/JsonWebKeySet',
'model/LoginRequest',
'model/OAuth2Client',
'model/OAuth2TokenIntrospection',
'model/OauthTokenResponse',
'model/PreviousConsentSession',
'model/RejectRequest',
'model/UserinfoResponse',
'model/WellKnown'
Expand All @@ -44,13 +44,13 @@
require('../model/CompletedRequest'),
require('../model/ConsentRequest'),
require('../model/FlushInactiveOAuth2TokensRequest'),
require('../model/HandledConsentRequestResponse'),
require('../model/InlineResponse401'),
require('../model/JsonWebKeySet'),
require('../model/LoginRequest'),
require('../model/OAuth2Client'),
require('../model/OAuth2TokenIntrospection'),
require('../model/OauthTokenResponse'),
require('../model/PreviousConsentSession'),
require('../model/RejectRequest'),
require('../model/UserinfoResponse'),
require('../model/WellKnown')
Expand All @@ -69,15 +69,15 @@
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.ConsentRequest,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer
.FlushInactiveOAuth2TokensRequest,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer
.HandledConsentRequestResponse,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.InlineResponse401,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.JsonWebKeySet,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.LoginRequest,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.OAuth2Client,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer
.OAuth2TokenIntrospection,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.OauthTokenResponse,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer
.PreviousConsentSession,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.RejectRequest,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.UserinfoResponse,
root.OryHydraCloudNativeOAuth20AndOpenIdConnectServer.WellKnown
Expand All @@ -90,13 +90,13 @@
CompletedRequest,
ConsentRequest,
FlushInactiveOAuth2TokensRequest,
HandledConsentRequestResponse,
InlineResponse401,
JsonWebKeySet,
LoginRequest,
OAuth2Client,
OAuth2TokenIntrospection,
OauthTokenResponse,
PreviousConsentSession,
RejectRequest,
UserinfoResponse,
WellKnown
Expand Down Expand Up @@ -695,7 +695,7 @@
* Callback function to receive the result of the listUserClientConsentSessions operation.
* @callback module:api/OAuth2Api~listUserClientConsentSessionsCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/HandledConsentRequestResponse>} data The data returned by the service call.
* @param {Array.<module:model/PreviousConsentSession>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/

Expand All @@ -704,7 +704,7 @@
* This endpoint lists all user&#39;s granted consent sessions, including client and granted scope
* @param {String} user
* @param {module:api/OAuth2Api~listUserClientConsentSessionsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/HandledConsentRequestResponse>}
* data is of type: {@link Array.<module:model/PreviousConsentSession>}
*/
this.listUserClientConsentSessions = function(user, callback) {
var postBody = null
Expand All @@ -726,7 +726,7 @@
var authNames = []
var contentTypes = ['application/json']
var accepts = ['application/json']
var returnType = [HandledConsentRequestResponse]
var returnType = [PreviousConsentSession]

return this.apiClient.callApi(
'/oauth2/auth/sessions/consent/{user}',
Expand Down
16 changes: 8 additions & 8 deletions sdk/js/swagger/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
'model/ExtKeyUsage',
'model/Extension',
'model/FlushInactiveOAuth2TokensRequest',
'model/HandledConsentRequestResponse',
'model/HealthNotReadyStatus',
'model/HealthStatus',
'model/IP',
Expand All @@ -52,6 +51,7 @@
'model/OauthTokenResponse',
'model/ObjectIdentifier',
'model/OpenIDConnectContext',
'model/PreviousConsentSession',
'model/PublicKeyAlgorithm',
'model/RawMessage',
'model/RejectRequest',
Expand Down Expand Up @@ -90,7 +90,6 @@
require('./model/ExtKeyUsage'),
require('./model/Extension'),
require('./model/FlushInactiveOAuth2TokensRequest'),
require('./model/HandledConsentRequestResponse'),
require('./model/HealthNotReadyStatus'),
require('./model/HealthStatus'),
require('./model/IP'),
Expand All @@ -112,6 +111,7 @@
require('./model/OauthTokenResponse'),
require('./model/ObjectIdentifier'),
require('./model/OpenIDConnectContext'),
require('./model/PreviousConsentSession'),
require('./model/PublicKeyAlgorithm'),
require('./model/RawMessage'),
require('./model/RejectRequest'),
Expand Down Expand Up @@ -149,7 +149,6 @@
ExtKeyUsage,
Extension,
FlushInactiveOAuth2TokensRequest,
HandledConsentRequestResponse,
HealthNotReadyStatus,
HealthStatus,
IP,
Expand All @@ -171,6 +170,7 @@
OauthTokenResponse,
ObjectIdentifier,
OpenIDConnectContext,
PreviousConsentSession,
PublicKeyAlgorithm,
RawMessage,
RejectRequest,
Expand Down Expand Up @@ -288,11 +288,6 @@
* @property {module:model/FlushInactiveOAuth2TokensRequest}
*/
FlushInactiveOAuth2TokensRequest: FlushInactiveOAuth2TokensRequest,
/**
* The HandledConsentRequestResponse model constructor.
* @property {module:model/HandledConsentRequestResponse}
*/
HandledConsentRequestResponse: HandledConsentRequestResponse,
/**
* The HealthNotReadyStatus model constructor.
* @property {module:model/HealthNotReadyStatus}
Expand Down Expand Up @@ -398,6 +393,11 @@
* @property {module:model/OpenIDConnectContext}
*/
OpenIDConnectContext: OpenIDConnectContext,
/**
* The PreviousConsentSession model constructor.
* @property {module:model/PreviousConsentSession}
*/
PreviousConsentSession: PreviousConsentSession,
/**
* The PublicKeyAlgorithm model constructor.
* @property {module:model/PublicKeyAlgorithm}
Expand Down
Loading

0 comments on commit 5234a6d

Please sign in to comment.