language stringlengths 0 24 | filename stringlengths 9 214 | code stringlengths 99 9.93M |
|---|---|---|
Go | hydra/oauth2/equalKeys_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import "testing"
func TestAssertObjectsAreEqualByKeys(t *testing.T) {
type foo struct {
Name string
Body int
}
a := &foo{"foo", 1}
b := &foo{"bar", 1}
c := &foo{"baz", 3}
AssertObjectKeysEqual(t, a, a, "Name", "Body")
Ass... |
Go | hydra/oauth2/fosite_store_helpers.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"context"
"crypto/sha256"
"fmt"
"net/url"
"testing"
"time"
"github.com/ory/hydra/v2/flow"
"github.com/ory/hydra/v2/jwk"
"github.com/go-jose/go-jose/v3"
"github.com/gobuffalo/pop/v6"
"github.com/pborman/uuid"
"g... |
Go | hydra/oauth2/fosite_store_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"flag"
"testing"
"github.com/stretchr/testify/require"
"github.com/ory/hydra/v2/client"
"github.com/ory/hydra/v2/driver"
"github.com/ory/hydra/v2/driver/config"
"github.com/ory/hydra/v2/internal"
. "... |
Go | hydra/oauth2/handler.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"encoding/base64"
"encoding/json"
"fmt"
"html/template"
"net/http"
"reflect"
"strings"
"time"
"github.com/tidwall/gjson"
"github.com/pborman/uuid"
"github.com/ory/hydra/v2/x/events"
"github.com/ory/x/httprouterx... |
Go | hydra/oauth2/handler_fallback_endpoints.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"html/template"
"net/http"
"github.com/ory/hydra/v2/driver/config"
"github.com/julienschmidt/httprouter"
)
func (h *Handler) fallbackHandler(title, heading string, sc int, configKey string) httprouter.Handle {
if titl... |
Go | hydra/oauth2/handler_fallback_endpoints_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"io"
"net/http"
"net/http/httptest"
"testing"
"github.com/ory/x/httprouterx"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/contextx"
"github.com/ory/hydra/v2/driver/config"
"github.com/ory/hydra/v2... |
Go | hydra/oauth2/handler_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"time"
hydra "github.com/ory/hydra-client-go/v2"
"github.com/ory/x/httprouterx"
"github.com/ory/x/snapshot... |
Go | hydra/oauth2/helper_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"github.com/ory/fosite"
"github.com/ory/fosite/handler/oauth2"
"github.com/ory/fosite/token/hmac"
)
func Tokens(c fosite.Configurator, length int) (res [][]string) {
s := &oauth2.HMACSHAStrategy{Enigma: ... |
Go | hydra/oauth2/introspector.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
// Introspection contains an access token's session data as specified by
// [IETF RFC 7662](https://tools.ietf.org/html/rfc7662)
//
// swagger:model introspectedOAuth2Token
type Introspection struct {
// Active is a boolean indicator... |
Go | hydra/oauth2/introspector_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
hydra "github.com/ory/hydra-client-go/v2"
"github.com/ory/x/httprouterx"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/contextx"
"... |
Go | hydra/oauth2/oauth2_auth_code_bench_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"flag"
"net/http"
"os"
"runtime"
"runtime/pprof"
"strings"
"sync/atomic"
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"
"github.co... |
Go | hydra/oauth2/oauth2_auth_code_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/url"
"strconv"
"strings"
"sync"
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/g... |
Go | hydra/oauth2/oauth2_client_credentials_bench_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"encoding/json"
"net/url"
"strings"
"testing"
"time"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tidwall/gjson"
"go.opentelemetry.... |
Go | hydra/oauth2/oauth2_client_credentials_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"time"
"github.com/google/uuid"
"github.com/tidwall/gjson"
"github.com/stretchr/testify/assert"
"github.com/stretchr/te... |
Go | hydra/oauth2/oauth2_helper_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"net/http"
"time"
"github.com/pkg/errors"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/flow"
"github.com/ory/x/sqlxx"
"github.com/ory/hydra/v2/client"
"github.com/ory/hydra/v2/consent"
)
var _ ... |
Go | hydra/oauth2/oauth2_jwt_bearer_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/google/uuid"
"github.com/tidwall/gjson"
"github.com/ory... |
Go | hydra/oauth2/oauth2_provider_mock_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: OAuth2Provider)
// Package oauth2_test is a generated GoMock package.
package oauth2_test
import (
context "context"
http "net/http"
reflect "reflect"
gom... |
Go | hydra/oauth2/oauth2_refresh_token_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"errors"
"fmt"
"math/rand"
"net/url"
"strings"
"sync"
"testing"
"time"
"github.com/gofrs/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ory/fosite"
... |
Go | hydra/oauth2/refresh_hook.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"context"
"encoding/json"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/errorsx"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/driver/config"
)
// Requester is a token endpoint's request context.
//
// swagger:ign... |
Go | hydra/oauth2/registry.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"github.com/ory/fosite"
"github.com/ory/fosite/handler/openid"
"github.com/ory/hydra/v2/aead"
"github.com/ory/hydra/v2/client"
"github.com/ory/hydra/v2/consent"
"github.com/ory/hydra/v2/jwk"
"github.com/ory/hydra/v2/oa... |
Go | hydra/oauth2/revocator_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/gobuffalo/pop/v6"
"github.com/ory/x/httprouterx"
"github.com/ory/hydra/v2/persistence/sql"
"github.com/ory/x/contextx"
hydra "git... |
Go | hydra/oauth2/session.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"context"
"encoding/json"
"time"
"github.com/pkg/errors"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
"github.com/mohae/deepcopy"
"github.com/ory/fosite"
"github.com/ory/fosite/handler/openid"
"github.co... |
Go | hydra/oauth2/session_custom_claims_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2_test
import (
"context"
"testing"
"github.com/ory/fosite/handler/openid"
"github.com/ory/fosite/token/jwt"
"github.com/ory/hydra/v2/driver/config"
"github.com/ory/hydra/v2/internal"
"github.com/ory/hydra/v2/oauth2"
"github.... |
Go | hydra/oauth2/session_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"encoding/json"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/ory/fosite"
"github.com/ory/fosite/handler/openid"
"github.com/ory/fosite/token/jwt"
"github.com/ory/x/assertx"
"github.com/ory/x/s... |
Go | hydra/oauth2/token_hook.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package oauth2
import (
"bytes"
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/hashicorp/go-retryablehttp"
"github.com/ory/hydra/v2/flow"
"github.com/ory/hydra/v2/x"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/driver/co... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=0-description=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured-hook=legacy.json | {
"subject": "foo",
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": ""... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=0-description=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=2-description=should_pass_because_prompt=none_and_max_age_is_less_than_auth_time-should_call_refresh_token_hook_if_configured-hook=legacy.json | {
"subject": "foo",
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": ""... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=2-description=should_pass_because_prompt=none_and_max_age_is_less_than_auth_time-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=5-description=should_pass_with_prompt=login_when_authentication_time_is_recent-should_call_refresh_token_hook_if_configured-hook=legacy.json | {
"subject": "foo",
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": ""... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=jwt-case=5-description=should_pass_with_prompt=login_when_authentication_time_is_recent-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=opaque-case=0-description=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured-hook=legacy.json | {
"subject": "foo",
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": ""... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=opaque-case=0-description=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=opaque-case=2-description=should_pass_because_prompt=none_and_max_age_is_less_than_auth_time-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=opaque-case=5-description=should_pass_with_prompt=login_when_authentication_time_is_recent-should_call_refresh_token_hook_if_configured-hook=legacy.json | {
"subject": "foo",
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": ""... |
JSON | hydra/oauth2/.snapshots/TestAuthCodeWithMockStrategy-strategy=opaque-case=5-description=should_pass_with_prompt=login_when_authentication_time_is_recent-should_call_refresh_token_hook_if_configured-hook=new.json | {
"session": {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://localhost:4444/",
"sub": "foo",
"aud": [
"app-client"
],
"nonce": "",
"at_hash": "",
"acr": "1",
"amr": null,
"c_hash": "",
"ext": {
... |
JSON | hydra/oauth2/.snapshots/TestHandlerWellKnown-hsm_enabled=false.json | {
"authorization_endpoint": "http://hydra.localhost/oauth2/auth",
"backchannel_logout_session_supported": true,
"backchannel_logout_supported": true,
"claims_parameter_supported": false,
"claims_supported": [
"sub"
],
"code_challenge_methods_supported": [
"plain",
"S256"
],
"credentials_en... |
JSON | hydra/oauth2/.snapshots/TestHandlerWellKnown-hsm_enabled=true.json | {
"authorization_endpoint": "http://hydra.localhost/oauth2/auth",
"backchannel_logout_session_supported": true,
"backchannel_logout_supported": true,
"claims_parameter_supported": false,
"claims_supported": [
"sub"
],
"code_challenge_methods_supported": [
"plain",
"S256"
],
"credentials_en... |
JSON | hydra/oauth2/.snapshots/TestUnmarshalSession-v1.11.8.json | {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://127.0.0.1:4444/",
"sub": "foo@bar.com",
"aud": [
"auth-code-client"
],
"nonce": "mbxojlzlkefzmlecvrzfkmpm",
"exp": "0001-01-01T00:00:00Z",
"iat": "2022-08-25T09:21:04Z",
"rat": "2022-08-25T... |
JSON | hydra/oauth2/.snapshots/TestUnmarshalSession-v1.11.9.json | {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://127.0.0.1:4444/",
"sub": "foo@bar.com",
"aud": [
"auth-code-client"
],
"nonce": "mbxojlzlkefzmlecvrzfkmpm",
"exp": "0001-01-01T00:00:00Z",
"iat": "2022-08-25T09:21:04Z",
"rat": "2022-08-25T... |
JSON | hydra/oauth2/fixtures/v1.11.8-session.json | {
"idToken": {
"Claims": {
"JTI": "",
"Issuer": "http://127.0.0.1:4444/",
"Subject": "foo@bar.com",
"Audience": ["auth-code-client"],
"Nonce": "mbxojlzlkefzmlecvrzfkmpm",
"ExpiresAt": "0001-01-01T00:00:00Z",
"IssuedAt": "2022-08-25T09:21:04Z",
"RequestedAt": "2022-0... |
JSON | hydra/oauth2/fixtures/v1.11.9-session.json | {
"id_token": {
"id_token_claims": {
"jti": "",
"iss": "http://127.0.0.1:4444/",
"sub": "foo@bar.com",
"aud": ["auth-code-client"],
"nonce": "mbxojlzlkefzmlecvrzfkmpm",
"exp": "0001-01-01T00:00:00Z",
"iat": "2022-08-25T09:21:04Z",
"rat": "2022-08-25T09:20:54Z",
... |
Go | hydra/oauth2/flowctx/cookies.go | // Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package flowctx
import "github.com/ory/hydra/v2/client"
type (
CookieSuffixer interface {
CookieSuffix() string
}
StaticSuffix string
clientID string
)
func (s StaticSuffix) CookieSuffix() string { return string(s) }
func (s clientID) G... |
Go | hydra/oauth2/flowctx/encoding.go | // Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package flowctx
import (
"bytes"
"compress/gzip"
"context"
"encoding/json"
"net/http"
"github.com/pkg/errors"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/aead"
"github.com/ory/hydra/v2/driver/config"
)
type (
data struct {
Purpos... |
Go | hydra/oauth2/trust/doc.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
// Package trust implements jwt-bearer grant management capabilities
//
// JWT-Bearer Grant represents resource owner (RO) permission for client to act on behalf of the RO using jwt.
// Client uses jwt to request access token to act as RO.
package tr... |
Go | hydra/oauth2/trust/error.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"net/http"
"github.com/ory/fosite"
)
var ErrMissingRequiredParameter = &fosite.RFC6749Error{
DescriptionField: "One of the required parameters is missing. Check your request parameters.",
ErrorField: "missing_requi... |
Go | hydra/oauth2/trust/grant.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"time"
)
type Grant struct {
ID string `json:"id"`
// Issuer identifies the principal that issued the JWT assertion (same as iss claim in jwt).
Issuer string `json:"issuer"`
// Subject identifies the principal that is ... |
Go | hydra/oauth2/trust/handler.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"encoding/json"
"net/http"
"time"
"github.com/ory/fosite"
"github.com/ory/x/pagination/tokenpagination"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/httprouterx"
"github.com/google/uuid"
"github.com/julienschmid... |
Go | hydra/oauth2/trust/handler_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust_test
import (
"bytes"
"context"
"crypto/rand"
"crypto/rsa"
"encoding/json"
"io"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/tidwall/gjson"
"github.com/ory/x/pointerx"
"gi... |
Go | hydra/oauth2/trust/manager.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"context"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/gofrs/uuid"
)
type GrantManager interface {
CreateGrant(ctx context.Context, g Grant, publicKey jose.JSONWebKey) error
GetConcreteGrant(ctx context.Context, ... |
Go | hydra/oauth2/trust/manager_test_helpers.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"context"
"sort"
"testing"
"time"
"github.com/ory/x/josex"
"github.com/go-jose/go-jose/v3"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ory/hydra/... |
Go | hydra/oauth2/trust/registry.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"github.com/ory/hydra/v2/x"
)
type InternalRegistry interface {
x.RegistryWriter
x.RegistryLogger
Registry
}
type Registry interface {
GrantManager() GrantManager
GrantValidator() *GrantValidator
} |
Go | hydra/oauth2/trust/request.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"time"
"github.com/go-jose/go-jose/v3"
)
type createGrantRequest struct {
// Issuer identifies the principal that issued the JWT assertion (same as iss claim in jwt).
Issuer string `json:"issuer"`
// Subject identifies... |
Go | hydra/oauth2/trust/validator.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"github.com/ory/x/errorsx"
)
type GrantValidator struct {
}
func NewGrantValidator() *GrantValidator {
return &GrantValidator{}
}
func (v *GrantValidator) Validate(request createGrantRequest) error {
if request.Issuer ==... |
Go | hydra/oauth2/trust/validator_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package trust
import (
"testing"
"time"
"github.com/go-jose/go-jose/v3"
)
func TestEmptyIssuerIsInvalid(t *testing.T) {
v := GrantValidator{}
r := createGrantRequest{
Issuer: "",
Subject: "valid-subject",
AllowAnySubje... |
Go | hydra/persistence/definitions.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package persistence
import (
"context"
"github.com/gofrs/uuid"
"github.com/ory/x/networkx"
"github.com/gobuffalo/pop/v6"
"github.com/ory/hydra/v2/client"
"github.com/ory/hydra/v2/consent"
"github.com/ory/hydra/v2/jwk"
"github.com/ory/hyd... |
Go | hydra/persistence/sql/persister.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"database/sql"
"io/fs"
"reflect"
"github.com/gobuffalo/pop/v6"
"github.com/gofrs/uuid"
"github.com/pkg/errors"
"github.com/ory/fosite"
"github.com/ory/fosite/storage"
"github.com/ory/hydra/v2/aead"
"github... |
Go | hydra/persistence/sql/persister_client.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"github.com/ory/hydra/v2/x/events"
"github.com/gobuffalo/pop/v6"
"github.com/gofrs/uuid"
"github.com/ory/x/errorsx"
"github.com/ory/x/otelx"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/client"
"github... |
Go | hydra/persistence/sql/persister_consent.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/gobuffalo/pop/v6"
"github.com/gofrs/uuid"
"github.com/ory/hydra/v2/oauth2/flowctx"
"github.com/ory/x/otelx"
"github.com/ory/x/sqlxx"
"github.com/ory/x/err... |
Go | hydra/persistence/sql/persister_grant_jwk.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"strings"
"time"
"github.com/pkg/errors"
"github.com/go-jose/go-jose/v3"
"github.com/gobuffalo/pop/v6"
"github.com/ory/hydra/v2/oauth2/trust"
"github.com/ory/x/otelx"
"github.com/ory/x/stringsx"
"github.c... |
Go | hydra/persistence/sql/persister_jwk.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"encoding/json"
"github.com/go-jose/go-jose/v3"
"github.com/gobuffalo/pop/v6"
"github.com/ory/x/errorsx"
"github.com/pkg/errors"
"github.com/ory/hydra/v2/jwk"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/... |
Go | hydra/persistence/sql/persister_migration.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"embed"
"fmt"
"strconv"
"strings"
"time"
"github.com/gobuffalo/pop/v6"
"github.com/ory/x/popx"
"github.com/ory/x/errorsx"
"github.com/ory/x/sqlcon"
)
//go:embed migrations/*.sql
var migrations embed.FS
... |
Go | hydra/persistence/sql/persister_nid_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql_test
import (
"context"
"database/sql"
"encoding/json"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/ory/hydra/v2/persistence"
"github.com/ory/x/uuidx"
"github.com/ory/x/assertx"
"github.com/go-jose/go-j... |
Go | hydra/persistence/sql/persister_nonce.go | // Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"time"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/x"
"github.com/ory/x/errorsx"
"github.com/ory/x/otelx"
)
// Set the aadAccessTokenPrefix to something unique to avoid ciphertext confusion with other usag... |
Go | hydra/persistence/sql/persister_nonce_test.go | // Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql_test
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ory/fosite"
"github.com/ory/hydra/v2/internal"
"github.com/ory/x/contextx"
"github.com/ory/x/randx... |
Go | hydra/persistence/sql/persister_oauth2.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql
import (
"context"
"crypto/sha256"
"crypto/sha512"
"database/sql"
"encoding/hex"
"encoding/json"
"fmt"
"net/url"
"strings"
"time"
"go.opentelemetry.io/otel/trace"
"github.com/gofrs/uuid"
"github.com/pkg/errors"
"github.co... |
Go | hydra/persistence/sql/persister_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package sql_test
import (
"context"
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/gobuffalo/pop/v6"
"github.com/gofrs/uuid"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
... |
Go | hydra/persistence/sql/migratest/assertion_helpers.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package migratest
import (
"testing"
"time"
"github.com/gofrs/uuid"
"github.com/stretchr/testify/require"
"github.com/ory/hydra/v2/flow"
testhelpersuuid "github.com/ory/hydra/v2/internal/testhelpers/uuid"
"github.com/ory/x/sqlxx"
)
func fi... |
Go | hydra/persistence/sql/migratest/migration_test.go | // Copyright © 2022 Ory Corp
// SPDX-License-Identifier: Apache-2.0
package migratest
import (
"context"
"encoding/json"
"fmt"
"os"
"path/filepath"
"testing"
"time"
"github.com/ory/hydra/v2/internal"
"github.com/ory/x/contextx"
"github.com/bradleyjkemp/cupaloy/v2"
"github.com/fatih/structs"
"github.com... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0001.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0001",
"Contacts": [
"contact-0001_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0002.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0002",
"Contacts": [
"contact-0002_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0003.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0003",
"Contacts": [
"contact-0003_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0004.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0004",
"Contacts": [
"contact-0004_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0005.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0005",
"Contacts": [
"contact-0005_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0006.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0006",
"Contacts": [
"contact-0006_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0007.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0007",
"Contacts": [
"contact-0007_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutSessionRequired": false,
"F... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0008.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0008_1"
],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0008",
"Contacts": [
"contact-0008_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutS... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0009.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0009_1"
],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0009",
"Contacts": [
"contact-0009_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutS... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0010.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0010_1"
],
"Audience": [],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0010",
"Contacts": [
"contact-0010_1"
],
"CreatedAt": "0001-01-01T00:00:00Z",
"FrontChannelLogoutS... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0011.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0011_1"
],
"Audience": [
"autdience-0011_1"
],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0011",
"Contacts": [
"contact-0011_1"
],
"CreatedAt": "0001-01-01T00:00:00... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0012.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0012_1"
],
"Audience": [
"autdience-0012_1"
],
"BackChannelLogoutSessionRequired": false,
"BackChannelLogoutURI": "",
"ClientURI": "http://client/0012",
"Contacts": [
"contact-0012_1"
],
"CreatedAt": "0001-01-01T00:00:00... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0013.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0013_1"
],
"Audience": [
"autdience-0013_1"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/0013",
"ClientURI": "http://client/0013",
"Contacts": [
"contact-0013_1"
],
"CreatedAt"... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0014.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0014_1"
],
"Audience": [
"autdience-0014_1"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/0014",
"ClientURI": "http://client/0014",
"Contacts": [
"contact-0014_1"
],
"CreatedAt"... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-0015.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/0015_1"
],
"Audience": [
"autdience-0015_1"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/0015",
"ClientURI": "http://client/0015",
"Contacts": [
"contact-0015_1"
],
"CreatedAt"... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-20.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/20_1"
],
"Audience": [
"autdience-20_1"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/20",
"ClientURI": "http://client/20",
"Contacts": [
"contact-20_1"
],
"CreatedAt": "0001-01... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-2005.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/2005_1"
],
"Audience": [
"autdience-2005_1"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/2005",
"ClientURI": "http://client/2005",
"Contacts": [
"contact-2005_1"
],
"CreatedAt"... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_client/client-21.json | {
"AccessTokenStrategy": "",
"AllowedCORSOrigins": [
"http://cors/21_1",
"http://cors/21_2"
],
"Audience": [
"autdience-21_1",
"autdience-21_2"
],
"BackChannelLogoutSessionRequired": true,
"BackChannelLogoutURI": "http://back_logout/21",
"ClientURI": "http://client/21",
"Contacts": [
... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0001.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0001",
"KID": "kid-0001",
"Version": 1,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0001"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0002.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0002",
"KID": "kid-0002",
"Version": 2,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0002"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0003.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0003",
"KID": "kid-0003",
"Version": 3,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0003"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0004.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0004",
"KID": "kid-0004",
"Version": 4,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0004"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0005.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0005",
"KID": "kid-0005",
"Version": 4,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0005"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0008.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0008",
"KID": "kid-0008",
"Version": 2,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0002"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_jwk/kid-0009.json | {
"ID": "00000000-0000-0000-0000-000000000000",
"Set": "sid-0009",
"KID": "kid-0009",
"Version": 2,
"CreatedAt": "0001-01-01T00:00:00Z",
"Key": "key-0002"
} |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0001.json | {
"ID": "sig-0001",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0001",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0001",
"GrantedScope": "granted_scope-0001",
"RequestedAudience": "",
"Grant... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0002.json | {
"ID": "sig-0002",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0002",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0002",
"GrantedScope": "granted_scope-0002",
"RequestedAudience": "",
"Grant... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0003.json | {
"ID": "sig-0003",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0003",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0003",
"GrantedScope": "granted_scope-0003",
"RequestedAudience": "",
"Grant... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0004.json | {
"ID": "sig-0004",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0004",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0004",
"GrantedScope": "granted_scope-0004",
"RequestedAudience": "",
"Grant... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0005.json | {
"ID": "sig-0005",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0005",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0005",
"GrantedScope": "granted_scope-0005",
"RequestedAudience": "",
"Grant... |
JSON | hydra/persistence/sql/migratest/fixtures/hydra_oauth2_access/sig-0006.json | {
"ID": "sig-0006",
"NID": "00000000-0000-0000-0000-000000000000",
"Request": "req-0006",
"ConsentChallenge": {
"String": "",
"Valid": false
},
"RequestedAt": "0001-01-01T00:00:00Z",
"Client": "",
"Scopes": "scope-0006",
"GrantedScope": "granted_scope-0006",
"RequestedAudience": "",
"Grant... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.