Skip to content

Commit

Permalink
warden: replace response shorthands with more readable names
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas committed Oct 5, 2017
1 parent 1ae021e commit 3c00413
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 115 deletions.
38 changes: 19 additions & 19 deletions docs/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2906,48 +2906,48 @@
"description": "The warden access request (with token) response",
"type": "object",
"properties": {
"accessTokenExtra": {
"description": "Extra represents arbitrary session data.",
"type": "object",
"additionalProperties": {
"type": "object"
},
"x-go-name": "Extra"
},
"allowed": {
"description": "Allowed is true if the request is allowed and false otherwise.",
"type": "boolean",
"x-go-name": "Allowed"
},
"cid": {
"clientId": {
"description": "ClientID is the id of the OAuth2 client that requested the token.",
"type": "string",
"x-go-name": "ClientID"
},
"exp": {
"expiresAt": {
"description": "ExpiresAt is the expiry timestamp.",
"type": "string",
"x-go-name": "ExpiresAt"
},
"ext": {
"description": "Extra represents arbitrary session data.",
"type": "object",
"additionalProperties": {
"type": "object"
"grantedScopes": {
"description": "GrantedScopes is a list of scopes that the subject authorized when asked for consent.",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "Extra"
"x-go-name": "GrantedScopes"
},
"iat": {
"issuedAt": {
"description": "IssuedAt is the token creation time stamp.",
"type": "string",
"x-go-name": "IssuedAt"
},
"iss": {
"issuer": {
"description": "Issuer is the id of the issuer, typically an hydra instance.",
"type": "string",
"x-go-name": "Issuer"
},
"scopes": {
"description": "GrantedScopes is a list of scopes that the subject authorized when asked for consent.",
"type": "array",
"items": {
"type": "string"
},
"x-go-name": "GrantedScopes"
},
"sub": {
"subject": {
"description": "Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app.\nThis is usually a uuid but you can choose a urn or some other id too.",
"type": "string",
"x-go-name": "Subject"
Expand Down
16 changes: 8 additions & 8 deletions firewall/warden.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ import (
type Context struct {
// Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app.
// This is usually a uuid but you can choose a urn or some other id too.
Subject string `json:"sub"`
Subject string `json:"subject"`

// GrantedScopes is a list of scopes that the subject authorized when asked for consent.
GrantedScopes []string `json:"scopes"`
GrantedScopes []string `json:"grantedScopes"`

// Issuer is the id of the issuer, typically an hydra instance.
Issuer string `json:"iss"`
Issuer string `json:"issuer"`

// Audience is who the token was issued for. This is an OAuth2 app usually.
Audience string `json:"aud"`
// ClientID is id of the client the token was issued for..
ClientID string `json:"clientId"`

// IssuedAt is the token creation time stamp.
IssuedAt time.Time `json:"iat"`
IssuedAt time.Time `json:"issuedAt"`

// ExpiresAt is the expiry timestamp.
ExpiresAt time.Time `json:"exp"`
ExpiresAt time.Time `json:"expiresAt"`

// Extra represents arbitrary session data.
Extra map[string]interface{} `json:"ext"`
Extra map[string]interface{} `json:"accessTokenExtra"`
}

// AccessRequest is the warden's request object.
Expand Down
2 changes: 1 addition & 1 deletion oauth2/consent_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestConsentSDK(t *testing.T) {
got, _, err := client.GetOAuth2ConsentRequest(req.ID)
require.NoError(t, err)
assert.EqualValues(t, req.ID, got.Id)
assert.EqualValues(t, req.ClientID, got.ClientID)
assert.EqualValues(t, req.ClientID, got.ClientId)
assert.EqualValues(t, req.RequestedScopes, got.RequestedScopes)
assert.EqualValues(t, req.RedirectURL, got.RedirectUrl)

Expand Down
14 changes: 7 additions & 7 deletions sdk/go/hydra/swagger/docs/WardenTokenAccessRequestResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessTokenExtra** | [**map[string]interface{}**](interface{}.md) | Extra represents arbitrary session data. | [optional] [default to null]
**Allowed** | **bool** | Allowed is true if the request is allowed and false otherwise. | [optional] [default to null]
**Cid** | **string** | ClientID is the id of the OAuth2 client that requested the token. | [optional] [default to null]
**Exp** | **string** | ExpiresAt is the expiry timestamp. | [optional] [default to null]
**Ext** | [**map[string]interface{}**](interface{}.md) | Extra represents arbitrary session data. | [optional] [default to null]
**Iat** | **string** | IssuedAt is the token creation time stamp. | [optional] [default to null]
**Iss** | **string** | Issuer is the id of the issuer, typically an hydra instance. | [optional] [default to null]
**Scopes** | **[]string** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional] [default to null]
**Sub** | **string** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] [default to null]
**ClientId** | **string** | ClientID is the id of the OAuth2 client that requested the token. | [optional] [default to null]
**ExpiresAt** | **string** | ExpiresAt is the expiry timestamp. | [optional] [default to null]
**GrantedScopes** | **[]string** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional] [default to null]
**IssuedAt** | **string** | IssuedAt is the token creation time stamp. | [optional] [default to null]
**Issuer** | **string** | Issuer is the id of the issuer, typically an hydra instance. | [optional] [default to null]
**Subject** | **string** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
20 changes: 10 additions & 10 deletions sdk/go/hydra/swagger/warden_token_access_request_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ package swagger
// The warden access request (with token) response
type WardenTokenAccessRequestResponse struct {

// Extra represents arbitrary session data.
AccessTokenExtra map[string]interface{} `json:"accessTokenExtra,omitempty"`

// Allowed is true if the request is allowed and false otherwise.
Allowed bool `json:"allowed,omitempty"`

// ClientID is the id of the OAuth2 client that requested the token.
Cid string `json:"cid,omitempty"`
ClientId string `json:"clientId,omitempty"`

// ExpiresAt is the expiry timestamp.
Exp string `json:"exp,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`

// Extra represents arbitrary session data.
Ext map[string]interface{} `json:"ext,omitempty"`
// GrantedScopes is a list of scopes that the subject authorized when asked for consent.
GrantedScopes []string `json:"grantedScopes,omitempty"`

// IssuedAt is the token creation time stamp.
Iat string `json:"iat,omitempty"`
IssuedAt string `json:"issuedAt,omitempty"`

// Issuer is the id of the issuer, typically an hydra instance.
Iss string `json:"iss,omitempty"`

// GrantedScopes is a list of scopes that the subject authorized when asked for consent.
Scopes []string `json:"scopes,omitempty"`
Issuer string `json:"issuer,omitempty"`

// Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too.
Sub string `json:"sub,omitempty"`
Subject string `json:"subject,omitempty"`
}
14 changes: 7 additions & 7 deletions sdk/js/swagger/docs/WardenTokenAccessRequestResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accessTokenExtra** | **{String: Object}** | Extra represents arbitrary session data. | [optional]
**allowed** | **Boolean** | Allowed is true if the request is allowed and false otherwise. | [optional]
**cid** | **String** | ClientID is the id of the OAuth2 client that requested the token. | [optional]
**exp** | **String** | ExpiresAt is the expiry timestamp. | [optional]
**ext** | **{String: Object}** | Extra represents arbitrary session data. | [optional]
**iat** | **String** | IssuedAt is the token creation time stamp. | [optional]
**iss** | **String** | Issuer is the id of the issuer, typically an hydra instance. | [optional]
**scopes** | **[String]** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional]
**sub** | **String** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional]
**clientId** | **String** | ClientID is the id of the OAuth2 client that requested the token. | [optional]
**expiresAt** | **String** | ExpiresAt is the expiry timestamp. | [optional]
**grantedScopes** | **[String]** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional]
**issuedAt** | **String** | IssuedAt is the token creation time stamp. | [optional]
**issuer** | **String** | Issuer is the id of the issuer, typically an hydra instance. | [optional]
**subject** | **String** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional]


66 changes: 33 additions & 33 deletions sdk/js/swagger/src/model/WardenTokenAccessRequestResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,74 +70,74 @@
if (data) {
obj = obj || new exports();

if (data.hasOwnProperty('accessTokenExtra')) {
obj['accessTokenExtra'] = ApiClient.convertToType(data['accessTokenExtra'], {'String': Object});
}
if (data.hasOwnProperty('allowed')) {
obj['allowed'] = ApiClient.convertToType(data['allowed'], 'Boolean');
}
if (data.hasOwnProperty('cid')) {
obj['cid'] = ApiClient.convertToType(data['cid'], 'String');
}
if (data.hasOwnProperty('exp')) {
obj['exp'] = ApiClient.convertToType(data['exp'], 'String');
if (data.hasOwnProperty('clientId')) {
obj['clientId'] = ApiClient.convertToType(data['clientId'], 'String');
}
if (data.hasOwnProperty('ext')) {
obj['ext'] = ApiClient.convertToType(data['ext'], {'String': Object});
if (data.hasOwnProperty('expiresAt')) {
obj['expiresAt'] = ApiClient.convertToType(data['expiresAt'], 'String');
}
if (data.hasOwnProperty('iat')) {
obj['iat'] = ApiClient.convertToType(data['iat'], 'String');
if (data.hasOwnProperty('grantedScopes')) {
obj['grantedScopes'] = ApiClient.convertToType(data['grantedScopes'], ['String']);
}
if (data.hasOwnProperty('iss')) {
obj['iss'] = ApiClient.convertToType(data['iss'], 'String');
if (data.hasOwnProperty('issuedAt')) {
obj['issuedAt'] = ApiClient.convertToType(data['issuedAt'], 'String');
}
if (data.hasOwnProperty('scopes')) {
obj['scopes'] = ApiClient.convertToType(data['scopes'], ['String']);
if (data.hasOwnProperty('issuer')) {
obj['issuer'] = ApiClient.convertToType(data['issuer'], 'String');
}
if (data.hasOwnProperty('sub')) {
obj['sub'] = ApiClient.convertToType(data['sub'], 'String');
if (data.hasOwnProperty('subject')) {
obj['subject'] = ApiClient.convertToType(data['subject'], 'String');
}
}
return obj;
}

/**
* Extra represents arbitrary session data.
* @member {Object.<String, Object>} accessTokenExtra
*/
exports.prototype['accessTokenExtra'] = undefined;
/**
* Allowed is true if the request is allowed and false otherwise.
* @member {Boolean} allowed
*/
exports.prototype['allowed'] = undefined;
/**
* ClientID is the id of the OAuth2 client that requested the token.
* @member {String} cid
* @member {String} clientId
*/
exports.prototype['cid'] = undefined;
exports.prototype['clientId'] = undefined;
/**
* ExpiresAt is the expiry timestamp.
* @member {String} exp
* @member {String} expiresAt
*/
exports.prototype['exp'] = undefined;
exports.prototype['expiresAt'] = undefined;
/**
* Extra represents arbitrary session data.
* @member {Object.<String, Object>} ext
* GrantedScopes is a list of scopes that the subject authorized when asked for consent.
* @member {Array.<String>} grantedScopes
*/
exports.prototype['ext'] = undefined;
exports.prototype['grantedScopes'] = undefined;
/**
* IssuedAt is the token creation time stamp.
* @member {String} iat
* @member {String} issuedAt
*/
exports.prototype['iat'] = undefined;
exports.prototype['issuedAt'] = undefined;
/**
* Issuer is the id of the issuer, typically an hydra instance.
* @member {String} iss
*/
exports.prototype['iss'] = undefined;
/**
* GrantedScopes is a list of scopes that the subject authorized when asked for consent.
* @member {Array.<String>} scopes
* @member {String} issuer
*/
exports.prototype['scopes'] = undefined;
exports.prototype['issuer'] = undefined;
/**
* Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too.
* @member {String} sub
* @member {String} subject
*/
exports.prototype['sub'] = undefined;
exports.prototype['subject'] = undefined;



Expand Down
32 changes: 16 additions & 16 deletions sdk/js/swagger/test/model/WardenTokenAccessRequestResponse.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,50 +57,50 @@
//expect(instance).to.be.a(HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse);
});

it('should have the property allowed (base name: "allowed")', function() {
// uncomment below and update the code to test the property allowed
it('should have the property accessTokenExtra (base name: "accessTokenExtra")', function() {
// uncomment below and update the code to test the property accessTokenExtra
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property cid (base name: "cid")', function() {
// uncomment below and update the code to test the property cid
it('should have the property allowed (base name: "allowed")', function() {
// uncomment below and update the code to test the property allowed
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property exp (base name: "exp")', function() {
// uncomment below and update the code to test the property exp
it('should have the property clientId (base name: "clientId")', function() {
// uncomment below and update the code to test the property clientId
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property ext (base name: "ext")', function() {
// uncomment below and update the code to test the property ext
it('should have the property expiresAt (base name: "expiresAt")', function() {
// uncomment below and update the code to test the property expiresAt
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property iat (base name: "iat")', function() {
// uncomment below and update the code to test the property iat
it('should have the property grantedScopes (base name: "grantedScopes")', function() {
// uncomment below and update the code to test the property grantedScopes
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property iss (base name: "iss")', function() {
// uncomment below and update the code to test the property iss
it('should have the property issuedAt (base name: "issuedAt")', function() {
// uncomment below and update the code to test the property issuedAt
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property scopes (base name: "scopes")', function() {
// uncomment below and update the code to test the property scopes
it('should have the property issuer (base name: "issuer")', function() {
// uncomment below and update the code to test the property issuer
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});

it('should have the property sub (base name: "sub")', function() {
// uncomment below and update the code to test the property sub
it('should have the property subject (base name: "subject")', function() {
// uncomment below and update the code to test the property subject
//var instane = new HydraOAuth2OpenIdConnectServer.WardenTokenAccessRequestResponse();
//expect(instance).to.be();
});
Expand Down
14 changes: 7 additions & 7 deletions warden/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ type swaggerWardenTokenAccessRequestResponse struct {
type swaggerWardenTokenAccessRequestResponsePayload struct {
// Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app.
// This is usually a uuid but you can choose a urn or some other id too.
Subject string `json:"sub"`
Subject string `json:"subject"`

// GrantedScopes is a list of scopes that the subject authorized when asked for consent.
GrantedScopes []string `json:"scopes"`
GrantedScopes []string `json:"grantedScopes"`

// Issuer is the id of the issuer, typically an hydra instance.
Issuer string `json:"iss"`
Issuer string `json:"issuer"`

// ClientID is the id of the OAuth2 client that requested the token.
ClientID string `json:"cid"`
ClientID string `json:"clientId"`

// IssuedAt is the token creation time stamp.
IssuedAt string `json:"iat"`
IssuedAt string `json:"issuedAt"`

// ExpiresAt is the expiry timestamp.
ExpiresAt string `json:"exp"`
ExpiresAt string `json:"expiresAt"`

// Extra represents arbitrary session data.
Extra map[string]interface{} `json:"ext"`
Extra map[string]interface{} `json:"accessTokenExtra"`

// Allowed is true if the request is allowed and false otherwise.
Allowed bool `json:"allowed"`
Expand Down
Loading

0 comments on commit 3c00413

Please sign in to comment.