Skip to content

Commit

Permalink
jwk: Renames ES521 key generation algorithm to ES512
Browse files Browse the repository at this point in the history
Closes #651
  • Loading branch information
aeneasr committed Nov 28, 2017
1 parent 18e1bd1 commit 5798bb4
Show file tree
Hide file tree
Showing 75 changed files with 65 additions and 859 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ This list makes you aware of any breaking and substantial non-breaking changes.

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 0.10.0-alpha.22

The JWK algorithm `ES521` was renamed to `ES512`. If you want to generate a key using this algorithm, you have to use
the update name in the future.

## 0.10.0-alpha.16

Versions `0.10.0-alpha.13`, `0.10.0-alpha.14`, and `0.10.0-alpha.15` had issues with the static binary of ORY Hydra which has been resolved.
Expand Down
2 changes: 1 addition & 1 deletion cmd/keys_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ var keysCreateCmd = &cobra.Command{

func init() {
keysCmd.AddCommand(keysCreateCmd)
keysCreateCmd.Flags().StringP("alg", "a", "", "REQUIRED name that identifies the algorithm intended for use with the key. Supports: RS256, ES521, HS256")
keysCreateCmd.Flags().StringP("alg", "a", "", "REQUIRED name that identifies the algorithm intended for use with the key. Supports: RS256, ES512, HS256")

}
10 changes: 2 additions & 8 deletions docs/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1934,12 +1934,6 @@
"Handler": {
"type": "object",
"properties": {
"Generators": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/KeyGenerator"
}
},
"H": {
"$ref": "#/definitions/Writer"
},
Expand All @@ -1950,7 +1944,7 @@
"$ref": "#/definitions/Firewall"
}
},
"x-go-package": "github.com/ory/hydra/jwk"
"x-go-package": "github.com/ory/hydra/warden/group"
},
"KeyGenerator": {
"type": "object",
Expand Down Expand Up @@ -2179,7 +2173,7 @@
],
"properties": {
"alg": {
"description": "The algorithm to be used for creating the key. Supports \"RS256\", \"ES521\", \"HS512\", and \"HS256\"",
"description": "The algorithm to be used for creating the key. Supports \"RS256\", \"ES512\", \"HS512\", and \"HS256\"",
"type": "string",
"x-go-name": "Algorithm"
},
Expand Down
4 changes: 2 additions & 2 deletions jwk/generator_ecdsa521.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/square/go-jose"
)

type ECDSA521Generator struct{}
type ECDSA512Generator struct{}

func (g *ECDSA521Generator) Generate(id string) (*jose.JSONWebKeySet, error) {
func (g *ECDSA512Generator) Generate(id string) (*jose.JSONWebKeySet, error) {
key, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
if err != nil {
return nil, errors.Errorf("Could not generate key because %s", err)
Expand Down
2 changes: 1 addition & 1 deletion jwk/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestGenerator(t *testing.T) {
},
},
{
g: &ECDSA521Generator{},
g: &ECDSA512Generator{},
check: func(ks *jose.JSONWebKeySet) {
assert.Len(t, ks, 2)
assert.NotEmpty(t, ks.Keys[0].Key)
Expand Down
4 changes: 2 additions & 2 deletions jwk/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (h *Handler) GetGenerators() map[string]KeyGenerator {
if h.Generators == nil || len(h.Generators) == 0 {
h.Generators = map[string]KeyGenerator{
"RS256": &RS256Generator{},
"ES521": &ECDSA521Generator{},
"ES512": &ECDSA512Generator{},
"HS256": &HS256Generator{},
"HS512": &HS512Generator{},
}
Expand All @@ -66,7 +66,7 @@ func (h *Handler) SetRoutes(r *httprouter.Router) {

// swagger:model jsonWebKeySetGeneratorRequest
type createRequest struct {
// The algorithm to be used for creating the key. Supports "RS256", "ES521", "HS512", and "HS256"
// The algorithm to be used for creating the key. Supports "RS256", "ES512", "HS512", and "HS256"
// required: true
// in: body
Algorithm string `json:"alg"`
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/api_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

import (
Expand Down
21 changes: 7 additions & 14 deletions sdk/go/hydra/swagger/consent_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,20 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

import (
"time"
)

type ConsentRequest struct {

// ClientID is the client id that initiated the OAuth2 request.
ClientId string `json:"clientId,omitempty"`

// ExpiresAt is the time where the access request will expire.
ExpiresAt time.Time `json:"expiresAt,omitempty"`

// ID is the id of this consent request.
Id string `json:"id,omitempty"`

Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/consent_request_acceptance.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type ConsentRequestAcceptance struct {
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/consent_request_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type ConsentRequestManager struct {
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/consent_request_rejection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type ConsentRequestRejection struct {
Expand Down
24 changes: 10 additions & 14 deletions sdk/go/hydra/swagger/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,12 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

import (
"time"
)

// Context contains an access token's session data
type Context struct {

Expand All @@ -33,9 +23,15 @@ type Context struct {
// ClientID is id of the client the token was issued for..
ClientId string `json:"clientId,omitempty"`

// ExpiresAt is the expiry timestamp.
ExpiresAt time.Time `json:"expiresAt,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.
IssuedAt time.Time `json:"issuedAt,omitempty"`

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

Expand Down
1 change: 1 addition & 0 deletions sdk/go/hydra/swagger/docs/ConsentRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClientId** | **string** | ClientID is the client id that initiated the OAuth2 request. | [optional] [default to null]
**ExpiresAt** | [**time.Time**](time.Time.md) | ExpiresAt is the time where the access request will expire. | [optional] [default to null]
**Id** | **string** | ID is the id of this consent request. | [optional] [default to null]
**RedirectUrl** | **string** | Redirect URL is the URL where the user agent should be redirected to after the consent has been accepted or rejected. | [optional] [default to null]
**RequestedScopes** | **[]string** | RequestedScopes represents a list of scopes that have been requested by the OAuth2 request initiator. | [optional] [default to null]
Expand Down
2 changes: 2 additions & 0 deletions sdk/go/hydra/swagger/docs/Context.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessTokenExtra** | [**map[string]interface{}**](interface{}.md) | Extra represents arbitrary session data. | [optional] [default to null]
**ClientId** | **string** | ClientID is id of the client the token was issued for.. | [optional] [default to null]
**ExpiresAt** | [**time.Time**](time.Time.md) | 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** | [**time.Time**](time.Time.md) | 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]

Expand Down
2 changes: 1 addition & 1 deletion sdk/go/hydra/swagger/docs/JsonWebKeySetGeneratorRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Alg** | **string** | The algorithm to be used for creating the key. Supports \&quot;RS256\&quot;, \&quot;ES521\&quot;, \&quot;HS512\&quot;, and \&quot;HS256\&quot; | [default to null]
**Alg** | **string** | The algorithm to be used for creating the key. Supports \&quot;RS256\&quot;, \&quot;ES512\&quot;, \&quot;HS512\&quot;, and \&quot;HS256\&quot; | [default to null]
**Kid** | **string** | The kid of the key to be created | [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
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type Firewall struct {
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

// Group represents a warden group
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/group_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type GroupMembers struct {
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

type Handler struct {
Expand Down
14 changes: 0 additions & 14 deletions sdk/go/hydra/swagger/health_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/

// Copyright © 2017 Aeneas Rekkas <aeneas+oss@aeneas.io>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package swagger

import (
Expand Down

0 comments on commit 5798bb4

Please sign in to comment.