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

fix: move to ory sqa service #1768

Merged
merged 2 commits into from
Mar 24, 2020
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
1,098 changes: 847 additions & 251 deletions client/sql_migration_files.go

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions cmd/cli/handler_jwk_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cli

import (
"github.com/ory/x/josex"
"testing"

"github.com/ory/x/josex"
)

func Test_toSDKFriendlyJSONWebKey(t *testing.T) {
Expand Down Expand Up @@ -59,4 +60,4 @@ func Test_toSDKFriendlyJSONWebKey(t *testing.T) {
}
})
}
}
}
4 changes: 4 additions & 0 deletions cmd/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"strings"
"sync"

"github.com/segmentio/analytics-go"
"github.com/sirupsen/logrus"

"github.com/ory/hydra/driver"
Expand Down Expand Up @@ -267,6 +268,9 @@ func setup(d driver.Driver, cmd *cobra.Command) (admin *x.RouterAdmin, public *x
BuildVersion: d.Registry().BuildVersion(),
BuildTime: d.Registry().BuildDate(),
BuildHash: d.Registry().BuildHash(),
Config: &analytics.Config{
Endpoint: "https://sqa.ory.sh",
},
},
)

Expand Down
1,194 changes: 919 additions & 275 deletions consent/sql_migration_files.go

Large diffs are not rendered by default.

68 changes: 30 additions & 38 deletions docs/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1814,8 +1814,8 @@
},
"definitions": {
"JSONRawMessage": {
"description": "JSONRawMessage JSON raw message",
"type": "object"
"type": "object",
"title": "JSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger."
},
"JSONWebKey": {
"description": "It is important that this model object is named JSONWebKey for\n\"swagger generate spec\" to generate only on definition of a\nJSONWebKey.",
Expand Down Expand Up @@ -1905,7 +1905,7 @@
}
},
"JSONWebKeySet": {
"description": "JSONWebKeySet JSONWebKeySet It is important that this model object is named JSONWebKeySet for\n\"swagger generate spec\" to generate only on definition of a\nJSONWebKeySet. Since one with the same name is previously defined as\nclient.Client.JSONWebKeys and this one is last, this one will be\neffectively written in the swagger spec.",
"description": "It is important that this model object is named JSONWebKeySet for\n\"swagger generate spec\" to generate only on definition of a\nJSONWebKeySet. Since one with the same name is previously defined as\nclient.Client.JSONWebKeys and this one is last, this one will be\neffectively written in the swagger spec.",
"type": "object",
"properties": {
"keys": {
Expand All @@ -1918,7 +1918,6 @@
}
},
"JoseJSONWebKeySet": {
"description": "JoseJSONWebKeySet JoseJSONWebKeySet JoseJSONWebKeySet JoseJSONWebKeySet JoseJSONWebKeySet JoseJSONWebKeySet jose JSON web key set",
"type": "object"
},
"NullTime": {
Expand All @@ -1927,7 +1926,7 @@
"title": "NullTime implements sql.NullTime functionality."
},
"PreviousConsentSession": {
"description": "PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession The response used to return used consent requests\nsame as HandledLoginRequest, just with consent_request exposed as json",
"description": "PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession PreviousConsentSession The response used to return used consent requests\nsame as HandledLoginRequest, just with consent_request exposed as json",
"type": "object",
"properties": {
"consent_request": {
Expand All @@ -1948,7 +1947,7 @@
}
},
"handled_at": {
"description": "handled at\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time",
"description": "handled at\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time\nFormat: date-time",
"type": "string",
"format": "date-time"
},
Expand All @@ -1975,28 +1974,23 @@
},
"acceptConsentRequest": {
"type": "object",
"title": "The request payload used to accept a consent request.",
"title": "AcceptConsentRequest The request payload used to accept a consent request.",
"properties": {
"grant_access_token_audience": {
"description": "GrantedAudience sets the audience the user authorized the client to use. Should be a subset of `requested_access_token_audience`.",
"type": "array",
"items": {
"type": "string"
},
"$ref": "#/definitions/StringSlicePipeDelimiter"
},
"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"
},
"$ref": "#/definitions/StringSlicePipeDelimiter"
},
"handled_at": {
"description": "HandledAt contains the timestamp the consent request was handled.\nFormat: date-time",
"type": "string",
"format": "date-time",
"$ref": "#/definitions/NullTime"
},
"remember": {
Expand Down Expand Up @@ -2025,11 +2019,6 @@
"type": "string"
},
"context": {
"description": "Context is an optional object which can hold arbitrary data. The data will be made available when fetching the\nconsent request under the \"context\" field. This is useful in scenarios where login and consent endpoints share\ndata.",
"type": "object",
"additionalProperties": {
"type": "object"
},
"$ref": "#/definitions/JSONRawMessage"
},
"force_subject_identifier": {
Expand All @@ -2053,7 +2042,7 @@
},
"completedRequest": {
"type": "object",
"title": "CompletedRequest The response payload sent when accepting or rejecting a login or consent request.",
"title": "CompletedRequest CompletedRequest The response payload sent when accepting or rejecting a login or consent request.",
"properties": {
"redirect_to": {
"description": "RedirectURL is the URL which you should redirect the user to once the authentication process is completed.",
Expand All @@ -2063,7 +2052,7 @@
},
"consentRequest": {
"type": "object",
"title": "ConsentRequest Contains information on an ongoing consent request.",
"title": "ConsentRequest ConsentRequest Contains information on an ongoing consent request.",
"properties": {
"acr": {
"description": "ACR represents the Authentication AuthorizationContext Class Reference value for this authentication session. You can use it\nto express that, for example, a user authenticated using two factor authentication.",
Expand Down Expand Up @@ -2120,7 +2109,7 @@
},
"consentRequestSession": {
"type": "object",
"title": "ConsentRequestSession Used to pass session data to a consent request.",
"title": "ConsentRequestSession ConsentRequestSession Used to pass session data to a consent request.",
"properties": {
"access_token": {
"description": "AccessToken sets session data for the access and refresh token, as well as any future tokens issued by the\nrefresh grant. Keep in mind that this data will be available to anyone performing OAuth 2.0 Challenge Introspection.\nIf only your services can perform OAuth 2.0 Challenge Introspection, this is usually fine. But if third parties\ncan access that endpoint as well, sensitive data from the session might be exposed to them. Use with care!",
Expand All @@ -2139,11 +2128,11 @@
}
},
"flushInactiveOAuth2TokensRequest": {
"description": "FlushInactiveOAuth2TokensRequest flush inactive o auth2 tokens request",
"description": "FlushInactiveOAuth2TokensRequest FlushInactiveOAuth2TokensRequest flush inactive o auth2 tokens request",
"type": "object",
"properties": {
"notAfter": {
"description": "NotAfter sets after which point tokens should not be flushed. This is useful when you want to keep a history\nof recently issued tokens for auditing.\nFormat: date-time",
"description": "NotAfter sets after which point tokens should not be flushed. This is useful when you want to keep a history\nof recently issued tokens for auditing.\nFormat: date-time\nFormat: date-time",
"type": "string",
"format": "date-time"
}
Expand Down Expand Up @@ -2181,6 +2170,7 @@
}
},
"healthNotReadyStatus": {
"description": "HealthNotReadyStatus health not ready status",
"type": "object",
"properties": {
"errors": {
Expand All @@ -2193,7 +2183,7 @@
}
},
"healthStatus": {
"description": "HealthStatus health status",
"description": "HealthStatus HealthStatus health status",
"type": "object",
"properties": {
"status": {
Expand All @@ -2203,11 +2193,12 @@
}
},
"jsonWebKeySetGeneratorRequest": {
"description": "JSONWebKeySetGeneratorRequest json web key set generator request",
"type": "object",
"required": [
"alg",
"kid",
"use"
"use",
"kid"
],
"properties": {
"alg": {
Expand Down Expand Up @@ -2296,7 +2287,7 @@
},
"oAuth2Client": {
"type": "object",
"title": "OAuth2Client OAuth2Client OAuth2Client Client represents an OAuth 2.0 Client.",
"title": "Client represents an OAuth 2.0 Client.",
"properties": {
"allowed_cors_origins": {
"$ref": "#/definitions/StringSlicePipeDelimiter"
Expand Down Expand Up @@ -2337,7 +2328,7 @@
"$ref": "#/definitions/StringSlicePipeDelimiter"
},
"created_at": {
"description": "CreatedAt returns the timestamp of the client's creation.\nFormat: date-time\nFormat: date-time\nFormat: date-time",
"description": "CreatedAt returns the timestamp of the client's creation.",
"type": "string",
"format": "date-time"
},
Expand Down Expand Up @@ -2412,7 +2403,7 @@
"type": "string"
},
"updated_at": {
"description": "UpdatedAt returns the timestamp of the last update.\nFormat: date-time\nFormat: date-time\nFormat: date-time",
"description": "UpdatedAt returns the timestamp of the last update.",
"type": "string",
"format": "date-time"
},
Expand All @@ -2425,7 +2416,7 @@
"oAuth2TokenIntrospection": {
"description": "https://tools.ietf.org/html/rfc7662",
"type": "object",
"title": "Introspection contains an access token's session data as specified by IETF RFC 7662, see:",
"title": "OAuth2TokenIntrospection Introspection contains an access token's session data as specified by IETF RFC 7662, see:",
"required": [
"active"
],
Expand Down Expand Up @@ -2494,7 +2485,7 @@
}
},
"oauth2TokenResponse": {
"description": "The Access Token Response",
"description": "Oauth2TokenResponse The Access Token Response",
"type": "object",
"properties": {
"access_token": {
Expand Down Expand Up @@ -2526,7 +2517,7 @@
},
"openIDConnectContext": {
"type": "object",
"title": "OpenIDConnectContext Contains optional information about the OpenID Connect request.",
"title": "OpenIDConnectContext OpenIDConnectContext Contains optional information about the OpenID Connect request.",
"properties": {
"acr_values": {
"description": "ACRValues is the Authentication AuthorizationContext Class Reference requested in the OAuth 2.0 Authorization request.\nIt is a parameter defined by OpenID Connect and expresses which level of authentication (e.g. 2FA) is required.\n\nOpenID Connect defines it as follows:\n\u003e Requested Authentication AuthorizationContext Class Reference values. Space-separated string that specifies the acr values\nthat the Authorization Server is being requested to use for processing this Authentication Request, with the\nvalues appearing in order of preference. The Authentication AuthorizationContext Class satisfied by the authentication\nperformed is returned as the acr Claim Value, as specified in Section 2. The acr Claim is requested as a\nVoluntary Claim by this parameter.",
Expand Down Expand Up @@ -2561,7 +2552,7 @@
},
"rejectRequest": {
"type": "object",
"title": "RejectRequest The request payload used to accept a login or consent request.",
"title": "RejectRequest RejectRequest The request payload used to accept a login or consent request.",
"properties": {
"error": {
"description": "error",
Expand All @@ -2587,7 +2578,7 @@
}
},
"userinfoResponse": {
"description": "UserinfoResponse The userinfo response",
"description": "UserinfoResponse UserinfoResponse The userinfo response",
"type": "object",
"properties": {
"birthdate": {
Expand Down Expand Up @@ -2670,6 +2661,7 @@
}
},
"version": {
"description": "Version version",
"type": "object",
"properties": {
"version": {
Expand All @@ -2681,15 +2673,15 @@
"wellKnown": {
"description": "It includes links to several endpoints (e.g. /oauth2/token) and exposes information on supported signature algorithms\namong others.",
"type": "object",
"title": "WellKnown WellKnown WellKnown WellKnown represents important OpenID Connect discovery metadata",
"title": "WellKnown represents important OpenID Connect discovery metadata",
"required": [
"issuer",
"authorization_endpoint",
"token_endpoint",
"id_token_signing_alg_values_supported",
"issuer",
"jwks_uri",
"subject_types_supported",
"response_types_supported",
"id_token_signing_alg_values_supported"
"subject_types_supported",
"token_endpoint"
],
"properties": {
"authorization_endpoint": {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
github.com/jmoiron/sqlx v1.2.0
github.com/julienschmidt/httprouter v1.2.0
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/oleiade/reflections v1.0.0
github.com/olekukonko/tablewriter v0.0.1
Expand All @@ -43,6 +42,7 @@ require (
github.com/rs/cors v1.6.0
github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7
github.com/sawadashota/encrypta v0.0.2
github.com/segmentio/analytics-go v3.1.0+incompatible
github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.6
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,6 @@ github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsO
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103 h1:Z/i1e+gTZrmcGeZyWckaLfucYG6KYOXLWo4co8pZYNY=
github.com/mendsley/gojwk v0.0.0-20141217222730-4d5ec6e58103/go.mod h1:o9YPB5aGP8ob35Vy6+vyq3P3bWe7NQWzf+JLiXCiMaE=
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading