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

feat: support OIDC flows for apps #3216

Merged
merged 16 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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
14 changes: 12 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,23 @@ jobs:
echo 'RN_UI_PATH='"$(realpath react-native-ui)" >> $GITHUB_ENV
echo 'NODE_UI_PATH='"$(realpath node-ui)" >> $GITHUB_ENV
echo 'REACT_UI_PATH='"$(realpath react-ui)" >> $GITHUB_ENV
- run: |
./test/e2e/run.sh ${{ matrix.database }}
- name: "Run Cypress tests"
run: ./test/e2e/run.sh ${{ matrix.database }}
env:
RN_UI_PATH: react-native-ui
NODE_UI_PATH: node-ui
REACT_UI_PATH: react-ui
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# TODO(hperl): Enable this once the React Native app uses the new SDK
# - name: "Run Playwright tests"
# run: |
# cd test/e2e
# npm run playwright
# env:
# DB: ${{ matrix.database }}
# RN_UI_PATH: react-native-ui
# NODE_UI_PATH: node-ui
# REACT_UI_PATH: react-ui
hperl marked this conversation as resolved.
Show resolved Hide resolved
- if: failure()
uses: actions/upload-artifact@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test/e2e/.bin
pkged.go
coverage.*
schema.sql
*.sqlite
heap_profiler/
goroutine_dump/
inflight_trace_dump/
Expand Down
4 changes: 2 additions & 2 deletions cmd/cleanup/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func Test_ExecuteCleanupFailedDSN(t *testing.T) {
b := bytes.NewBufferString("")
cmd.SetOut(b)
cmd.SetArgs([]string{"--read-from-env=false"})
cmd.Execute()
_ = cmd.Execute()
out, err := io.ReadAll(b)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(out), "expected to get the DSN as an argument") {
t.Fatalf("expected \"%s\" got \"%s\"", "expected to get the DSN as an argument", string(out))
}
cmd.Execute()
_ = cmd.Execute()
}
3 changes: 3 additions & 0 deletions driver/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package driver
import (
"context"

"github.com/ory/kratos/selfservice/sessiontokenexchange"
"github.com/ory/x/contextx"
"github.com/ory/x/jsonnetsecure"
"github.com/ory/x/otelx"
Expand Down Expand Up @@ -138,6 +139,8 @@ type Registry interface {
verification.HandlerProvider
verification.StrategyProvider

sessiontokenexchange.PersistenceProvider

link.SenderProvider
link.VerificationTokenPersistenceProvider
link.RecoveryTokenPersistenceProvider
Expand Down
10 changes: 10 additions & 0 deletions driver/registry_default_sessiontokenexchange.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package driver

import "github.com/ory/kratos/selfservice/sessiontokenexchange"

func (m *RegistryDefault) SessionTokenExchangePersister() sessiontokenexchange.Persister {
return m.Persister()
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ require (
github.com/knadh/koanf v1.4.4
github.com/laher/mergefs v0.1.2-0.20230223191438-d16611b2f4e7
github.com/luna-duclos/instrumentedsql v1.1.3
github.com/mailhog/MailHog v1.0.1
github.com/mattn/goveralls v0.0.7
github.com/mikefarah/yq/v4 v4.19.1
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
Expand Down Expand Up @@ -152,7 +153,6 @@ require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fullstorydev/grpcurl v1.8.1 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
Expand Down Expand Up @@ -233,7 +233,6 @@ require (
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailhog/MailHog v1.0.1 // indirect
github.com/mailhog/MailHog-Server v1.0.1 // indirect
github.com/mailhog/MailHog-UI v1.0.1 // indirect
github.com/mailhog/data v1.0.1 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,6 @@ github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49P
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
Expand Down Expand Up @@ -649,6 +647,7 @@ github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
github.com/goreleaser/goreleaser v0.134.0/go.mod h1:ZT6Y2rSYa6NxQzIsdfWWNWAlYGXGbreo66NmE+3X3WQ=
Expand Down Expand Up @@ -892,6 +891,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jteeuwen/go-bindata v3.0.7+incompatible h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts=
github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
Expand Down Expand Up @@ -1304,8 +1304,10 @@ github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
github.com/slack-go/slack v0.7.4 h1:Z+7CmUDV+ym4lYLA4NNLFIpr3+nDgViHrx8xsuXgrYs=
github.com/slack-go/slack v0.7.4/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/gunit v1.0.0/go.mod h1:qwPWnhz6pn0NnRBP++URONOVyNkPyr4SauJk4cUOwJs=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
Expand Down
2 changes: 2 additions & 0 deletions internal/client-go/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ docs/SessionAuthenticationMethod.md
docs/SessionDevice.md
docs/SettingsFlow.md
docs/SettingsFlowState.md
docs/SuccessfulCodeExchangeResponse.md
docs/SuccessfulNativeLogin.md
docs/SuccessfulNativeRegistration.md
docs/TokenPagination.md
Expand Down Expand Up @@ -183,6 +184,7 @@ model_session_authentication_method.go
model_session_device.go
model_settings_flow.go
model_settings_flow_state.go
model_successful_code_exchange_response.go
model_successful_native_login.go
model_successful_native_registration.go
model_token_pagination.go
Expand Down
2 changes: 2 additions & 0 deletions internal/client-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Class | Method | HTTP request | Description
*FrontendApi* | [**CreateNativeVerificationFlow**](docs/FrontendApi.md#createnativeverificationflow) | **Get** /self-service/verification/api | Create Verification Flow for Native Apps
*FrontendApi* | [**DisableMyOtherSessions**](docs/FrontendApi.md#disablemyothersessions) | **Delete** /sessions | Disable my other sessions
*FrontendApi* | [**DisableMySession**](docs/FrontendApi.md#disablemysession) | **Delete** /sessions/{id} | Disable one of my sessions
*FrontendApi* | [**ExchangeSessionToken**](docs/FrontendApi.md#exchangesessiontoken) | **Get** /self-service/exchange-code-for-session-token | Exchange Session Token
*FrontendApi* | [**GetFlowError**](docs/FrontendApi.md#getflowerror) | **Get** /self-service/errors | Get User-Flow Errors
*FrontendApi* | [**GetLoginFlow**](docs/FrontendApi.md#getloginflow) | **Get** /self-service/login/flows | Get Login Flow
*FrontendApi* | [**GetRecoveryFlow**](docs/FrontendApi.md#getrecoveryflow) | **Get** /self-service/recovery/flows | Get Recovery Flow
Expand Down Expand Up @@ -198,6 +199,7 @@ Class | Method | HTTP request | Description
- [SessionDevice](docs/SessionDevice.md)
- [SettingsFlow](docs/SettingsFlow.md)
- [SettingsFlowState](docs/SettingsFlowState.md)
- [SuccessfulCodeExchangeResponse](docs/SuccessfulCodeExchangeResponse.md)
- [SuccessfulNativeLogin](docs/SuccessfulNativeLogin.md)
- [SuccessfulNativeRegistration](docs/SuccessfulNativeRegistration.md)
- [TokenPagination](docs/TokenPagination.md)
Expand Down
Loading