Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various minor fixes #667

Merged
merged 3 commits into from
Nov 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,17 @@ able to securely manage JSON Web Keys, and has a sophisticated policy-based acce
- [Building from source](#building-from-source)
- [Security](#security)
- [Telemetry](#telemetry)
- [Sponsors & Adopters](#sponsors-&-adopters)
- [Sponsors](#sponsors)
- [Sponsorship](#sponsorship)
- [Sponsors](#sponsors)
- [Adopters](#adopters)
- [Sponsors](#sponsors-1)
- [Documentation](#documentation)
- [Guide](#guide)
- [HTTP API documentation](#http-api-documentation)
- [Command line documentation](#command-line-documentation)
- [Develop](#develop)
- [Reception](#reception)
- [Libraries and third-party projects](#libraries-and-third-party-projects)
- [Blog posts & articles](#blog-posts-&-articles)
- [Blog posts & articles](#blog-posts--articles)

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

Expand Down Expand Up @@ -193,7 +192,7 @@ Read [the security guide now](https://ory.gitbooks.io/hydra/content/security.htm
ORY Hydra collects summarized, anonymized telemetry which can optionally be turned off. Click [here](https://ory.gitbooks.io/hydra/content/telemetry.html)
to learn more.

## Sponsors & Adopters
## Sponsors

ORY Hydra is open source with a permissive license. We are a dedicated, young but also experienced team of developers
in the area of cloud computing and internet security. Please support our mission for a safer web and become a sponsor, buy an
Expand All @@ -220,18 +219,6 @@ every year. At ORY, we use [Auth0](https://auth0.com) in conjunction with ORY Hy

<br clear="all"/>

### Adopters

ORY Hydra is battle-tested in production systems. This is a curated list of ORY Hydra adopters. [Tell us](mailto:hi@ory.am) if
you think that your company should be listed here.

<img src="https://www.arduino.cc/en/uploads/Trademark/ArduinoCommunityLogo.png" align="left" width="30%" alt="arduino.cc"/>

<p>Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended
for anyone making interactive projects. ORY Hydra secures Arduino's developer platform.</p>

<br clear="all"/>

## Documentation

### Guide
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/handler_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
)

func checkResponse(response *hydra.APIResponse, err error, expectedStatusCode int) {
pkg.Must(err, "Could not validate token: %s", err)
pkg.Must(err, "Command failed because error \"%s\" occurred.\n", err)

if response.StatusCode != expectedStatusCode {
fmt.Printf("Command failed because status code %d was expeceted but code %d was received.", expectedStatusCode, response.StatusCode)
fmt.Fprintf(os.Stderr, "Command failed because status code %d was expeceted but code %d was received.\n", expectedStatusCode, response.StatusCode)
os.Exit(1)
return
}
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")

}
2 changes: 1 addition & 1 deletion cmd/token_self.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var tokenSelfCmd = &cobra.Command{
}

t, err := oauthConfig.Token(ctx)
pkg.Must(err, "Could not authenticate, because: %s\n", err)
pkg.Must(err, "Could not retrieve access token because: %s", err)
fmt.Printf("%s\n", t.AccessToken)
},
}
Expand Down
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
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
Loading