diff --git a/persistence/sql/migratest/fixtures/login_request/202c1981-1e25-47f0-8764-75ad506c2bec.json b/persistence/sql/migratest/fixtures/login_flow/202c1981-1e25-47f0-8764-75ad506c2bec.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/202c1981-1e25-47f0-8764-75ad506c2bec.json rename to persistence/sql/migratest/fixtures/login_flow/202c1981-1e25-47f0-8764-75ad506c2bec.json index 7adf851357d..89911868673 100644 --- a/persistence/sql/migratest/fixtures/login_request/202c1981-1e25-47f0-8764-75ad506c2bec.json +++ b/persistence/sql/migratest/fixtures/login_flow/202c1981-1e25-47f0-8764-75ad506c2bec.json @@ -1,5 +1,6 @@ { "id": "202c1981-1e25-47f0-8764-75ad506c2bec", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/login_request/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json b/persistence/sql/migratest/fixtures/login_flow/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json rename to persistence/sql/migratest/fixtures/login_flow/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json index fcedbeb67af..b02b0e3c9f9 100644 --- a/persistence/sql/migratest/fixtures/login_request/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json +++ b/persistence/sql/migratest/fixtures/login_flow/3a9ea34f-0f12-469b-9417-3ae5795a7baa.json @@ -1,5 +1,6 @@ { "id": "3a9ea34f-0f12-469b-9417-3ae5795a7baa", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/login_request/43c99182-bb67-47e1-b564-bb23bd8d4393.json b/persistence/sql/migratest/fixtures/login_flow/43c99182-bb67-47e1-b564-bb23bd8d4393.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/43c99182-bb67-47e1-b564-bb23bd8d4393.json rename to persistence/sql/migratest/fixtures/login_flow/43c99182-bb67-47e1-b564-bb23bd8d4393.json index d27e64834ab..3dd07230fc8 100644 --- a/persistence/sql/migratest/fixtures/login_request/43c99182-bb67-47e1-b564-bb23bd8d4393.json +++ b/persistence/sql/migratest/fixtures/login_flow/43c99182-bb67-47e1-b564-bb23bd8d4393.json @@ -1,5 +1,6 @@ { "id": "43c99182-bb67-47e1-b564-bb23bd8d4393", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login?prompt=login\u0026return_to=http%3A%2F%2F127.0.0.1%3A4455%2F.ory%2Fkratos%2Fpublic%2Fself-service%2Fbrowser%2Fflows%2Fsettings%2Fstrategies%2Fprofile%3Frequest%3D74fd6c53-7651-453e-90b8-2c5adbf911bb", diff --git a/persistence/sql/migratest/fixtures/login_flow/47edd3a8-0998-4779-9469-f4b8ee4430df.json b/persistence/sql/migratest/fixtures/login_flow/47edd3a8-0998-4779-9469-f4b8ee4430df.json new file mode 100644 index 00000000000..20276e1a2bb --- /dev/null +++ b/persistence/sql/migratest/fixtures/login_flow/47edd3a8-0998-4779-9469-f4b8ee4430df.json @@ -0,0 +1,10 @@ +{ + "id": "47edd3a8-0998-4779-9469-f4b8ee4430df", + "type": "api", + "expires_at": "2013-10-07T08:23:19Z", + "issued_at": "2013-10-07T08:23:19Z", + "request_url": "http://kratos:4433/self-service/browser/flows/login", + "messages": [], + "methods": {}, + "forced": false +} \ No newline at end of file diff --git a/persistence/sql/migratest/fixtures/login_request/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json b/persistence/sql/migratest/fixtures/login_flow/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json similarity index 92% rename from persistence/sql/migratest/fixtures/login_request/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json rename to persistence/sql/migratest/fixtures/login_flow/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json index 8ff80a76466..2387636f407 100644 --- a/persistence/sql/migratest/fixtures/login_request/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json +++ b/persistence/sql/migratest/fixtures/login_flow/56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e.json @@ -1,5 +1,6 @@ { "id": "56d94e8b-8a5d-4b7f-8a6e-3259d2b2903e", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/login_request/6d387820-f2f4-4f9f-9980-a90d89e7811f.json b/persistence/sql/migratest/fixtures/login_flow/6d387820-f2f4-4f9f-9980-a90d89e7811f.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/6d387820-f2f4-4f9f-9980-a90d89e7811f.json rename to persistence/sql/migratest/fixtures/login_flow/6d387820-f2f4-4f9f-9980-a90d89e7811f.json index 20aee860579..68d1c3d64de 100644 --- a/persistence/sql/migratest/fixtures/login_request/6d387820-f2f4-4f9f-9980-a90d89e7811f.json +++ b/persistence/sql/migratest/fixtures/login_flow/6d387820-f2f4-4f9f-9980-a90d89e7811f.json @@ -1,5 +1,6 @@ { "id": "6d387820-f2f4-4f9f-9980-a90d89e7811f", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/login_request/916ded11-aa64-4a27-b06e-96e221a509d7.json b/persistence/sql/migratest/fixtures/login_flow/916ded11-aa64-4a27-b06e-96e221a509d7.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/916ded11-aa64-4a27-b06e-96e221a509d7.json rename to persistence/sql/migratest/fixtures/login_flow/916ded11-aa64-4a27-b06e-96e221a509d7.json index 7b673dbdddd..2294e7e8338 100644 --- a/persistence/sql/migratest/fixtures/login_request/916ded11-aa64-4a27-b06e-96e221a509d7.json +++ b/persistence/sql/migratest/fixtures/login_flow/916ded11-aa64-4a27-b06e-96e221a509d7.json @@ -1,5 +1,6 @@ { "id": "916ded11-aa64-4a27-b06e-96e221a509d7", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/login_request/99974ce6-388c-4669-a95a-7757ee724020.json b/persistence/sql/migratest/fixtures/login_flow/99974ce6-388c-4669-a95a-7757ee724020.json similarity index 98% rename from persistence/sql/migratest/fixtures/login_request/99974ce6-388c-4669-a95a-7757ee724020.json rename to persistence/sql/migratest/fixtures/login_flow/99974ce6-388c-4669-a95a-7757ee724020.json index 151315bb6be..2adb1b2b8e3 100644 --- a/persistence/sql/migratest/fixtures/login_request/99974ce6-388c-4669-a95a-7757ee724020.json +++ b/persistence/sql/migratest/fixtures/login_flow/99974ce6-388c-4669-a95a-7757ee724020.json @@ -1,5 +1,6 @@ { "id": "99974ce6-388c-4669-a95a-7757ee724020", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/login", diff --git a/persistence/sql/migratest/fixtures/recovery_request/13178936-095a-466b-abe0-36d977d3dc18.json b/persistence/sql/migratest/fixtures/recovery_flow/13178936-095a-466b-abe0-36d977d3dc18.json similarity index 97% rename from persistence/sql/migratest/fixtures/recovery_request/13178936-095a-466b-abe0-36d977d3dc18.json rename to persistence/sql/migratest/fixtures/recovery_flow/13178936-095a-466b-abe0-36d977d3dc18.json index d04f1ce2cf4..11875b225cc 100644 --- a/persistence/sql/migratest/fixtures/recovery_request/13178936-095a-466b-abe0-36d977d3dc18.json +++ b/persistence/sql/migratest/fixtures/recovery_flow/13178936-095a-466b-abe0-36d977d3dc18.json @@ -1,5 +1,6 @@ { "id": "13178936-095a-466b-abe0-36d977d3dc18", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/recovery_flow/87e871e1-a45f-4ed0-ba4e-a03063c774dc.json b/persistence/sql/migratest/fixtures/recovery_flow/87e871e1-a45f-4ed0-ba4e-a03063c774dc.json new file mode 100644 index 00000000000..c7bc6b4961d --- /dev/null +++ b/persistence/sql/migratest/fixtures/recovery_flow/87e871e1-a45f-4ed0-ba4e-a03063c774dc.json @@ -0,0 +1,11 @@ +{ + "id": "87e871e1-a45f-4ed0-ba4e-a03063c774dc", + "type": "api", + "expires_at": "2013-10-07T08:23:19Z", + "issued_at": "2013-10-07T08:23:19Z", + "request_url": "http://kratos:4433/self-service/browser/flows/registration", + "active": "link", + "messages": [], + "methods": {}, + "state": "choose_method" +} \ No newline at end of file diff --git a/persistence/sql/migratest/fixtures/registration_request/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json b/persistence/sql/migratest/fixtures/registration_flow/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json similarity index 98% rename from persistence/sql/migratest/fixtures/registration_request/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json rename to persistence/sql/migratest/fixtures/registration_flow/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json index 3dfa16404e8..73df4d6b56a 100644 --- a/persistence/sql/migratest/fixtures/registration_request/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json +++ b/persistence/sql/migratest/fixtures/registration_flow/05a7f09d-4ef3-41fb-958a-6ad74584b36a.json @@ -1,5 +1,6 @@ { "id": "05a7f09d-4ef3-41fb-958a-6ad74584b36a", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/registration_request/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json b/persistence/sql/migratest/fixtures/registration_flow/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json similarity index 98% rename from persistence/sql/migratest/fixtures/registration_request/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json rename to persistence/sql/migratest/fixtures/registration_flow/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json index 5dee70f9146..b054d060310 100644 --- a/persistence/sql/migratest/fixtures/registration_request/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json +++ b/persistence/sql/migratest/fixtures/registration_flow/22d58184-b97d-44a5-bbaf-0aa8b4000d81.json @@ -1,5 +1,6 @@ { "id": "22d58184-b97d-44a5-bbaf-0aa8b4000d81", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/registration_request/2bf132e0-5d40-4df9-9a11-9106e5333735.json b/persistence/sql/migratest/fixtures/registration_flow/2bf132e0-5d40-4df9-9a11-9106e5333735.json similarity index 98% rename from persistence/sql/migratest/fixtures/registration_request/2bf132e0-5d40-4df9-9a11-9106e5333735.json rename to persistence/sql/migratest/fixtures/registration_flow/2bf132e0-5d40-4df9-9a11-9106e5333735.json index f78796e1950..956a4b59519 100644 --- a/persistence/sql/migratest/fixtures/registration_request/2bf132e0-5d40-4df9-9a11-9106e5333735.json +++ b/persistence/sql/migratest/fixtures/registration_flow/2bf132e0-5d40-4df9-9a11-9106e5333735.json @@ -1,5 +1,6 @@ { "id": "2bf132e0-5d40-4df9-9a11-9106e5333735", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/registration_flow/696e7022-c466-44f6-89c6-8cf93c06a62a.json b/persistence/sql/migratest/fixtures/registration_flow/696e7022-c466-44f6-89c6-8cf93c06a62a.json new file mode 100644 index 00000000000..f2b3179d21b --- /dev/null +++ b/persistence/sql/migratest/fixtures/registration_flow/696e7022-c466-44f6-89c6-8cf93c06a62a.json @@ -0,0 +1,10 @@ +{ + "id": "696e7022-c466-44f6-89c6-8cf93c06a62a", + "type": "api", + "expires_at": "2013-10-07T08:23:19Z", + "issued_at": "2013-10-07T08:23:19Z", + "request_url": "http://kratos:4433/self-service/browser/flows/registration", + "active": "password", + "messages": [], + "methods": {} +} \ No newline at end of file diff --git a/persistence/sql/migratest/fixtures/registration_request/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json b/persistence/sql/migratest/fixtures/registration_flow/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json similarity index 98% rename from persistence/sql/migratest/fixtures/registration_request/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json rename to persistence/sql/migratest/fixtures/registration_flow/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json index 2719bf7a3bb..52b095eb7f5 100644 --- a/persistence/sql/migratest/fixtures/registration_request/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json +++ b/persistence/sql/migratest/fixtures/registration_flow/87fa3f43-5155-42b4-a1ad-174c2595fdaf.json @@ -1,5 +1,6 @@ { "id": "87fa3f43-5155-42b4-a1ad-174c2595fdaf", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/registration_request/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json b/persistence/sql/migratest/fixtures/registration_flow/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json similarity index 92% rename from persistence/sql/migratest/fixtures/registration_request/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json rename to persistence/sql/migratest/fixtures/registration_flow/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json index 2ff0531ac82..6ca7a773c87 100644 --- a/persistence/sql/migratest/fixtures/registration_request/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json +++ b/persistence/sql/migratest/fixtures/registration_flow/9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd.json @@ -1,5 +1,6 @@ { "id": "9edcf051-1cd0-44cc-bd2f-6ac21f0c24dd", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/registration", diff --git a/persistence/sql/migratest/fixtures/settings_request/194c5b05-0487-4a11-bcbc-f301c9ff9678.json b/persistence/sql/migratest/fixtures/settings_flow/194c5b05-0487-4a11-bcbc-f301c9ff9678.json similarity index 99% rename from persistence/sql/migratest/fixtures/settings_request/194c5b05-0487-4a11-bcbc-f301c9ff9678.json rename to persistence/sql/migratest/fixtures/settings_flow/194c5b05-0487-4a11-bcbc-f301c9ff9678.json index 058de6e71c5..ce2444eccea 100644 --- a/persistence/sql/migratest/fixtures/settings_request/194c5b05-0487-4a11-bcbc-f301c9ff9678.json +++ b/persistence/sql/migratest/fixtures/settings_flow/194c5b05-0487-4a11-bcbc-f301c9ff9678.json @@ -1,5 +1,6 @@ { "id": "194c5b05-0487-4a11-bcbc-f301c9ff9678", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/settings", diff --git a/persistence/sql/migratest/fixtures/settings_request/21c5f714-3089-49d2-b387-f244d4dd9e00.json b/persistence/sql/migratest/fixtures/settings_flow/21c5f714-3089-49d2-b387-f244d4dd9e00.json similarity index 99% rename from persistence/sql/migratest/fixtures/settings_request/21c5f714-3089-49d2-b387-f244d4dd9e00.json rename to persistence/sql/migratest/fixtures/settings_flow/21c5f714-3089-49d2-b387-f244d4dd9e00.json index 4cecd079a55..ecda5777cbd 100644 --- a/persistence/sql/migratest/fixtures/settings_request/21c5f714-3089-49d2-b387-f244d4dd9e00.json +++ b/persistence/sql/migratest/fixtures/settings_flow/21c5f714-3089-49d2-b387-f244d4dd9e00.json @@ -1,5 +1,6 @@ { "id": "21c5f714-3089-49d2-b387-f244d4dd9e00", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/settings", diff --git a/persistence/sql/migratest/fixtures/settings_request/74fd6c53-7651-453e-90b8-2c5adbf911bb.json b/persistence/sql/migratest/fixtures/settings_flow/74fd6c53-7651-453e-90b8-2c5adbf911bb.json similarity index 99% rename from persistence/sql/migratest/fixtures/settings_request/74fd6c53-7651-453e-90b8-2c5adbf911bb.json rename to persistence/sql/migratest/fixtures/settings_flow/74fd6c53-7651-453e-90b8-2c5adbf911bb.json index 07ac3698a62..c77772d54c8 100644 --- a/persistence/sql/migratest/fixtures/settings_request/74fd6c53-7651-453e-90b8-2c5adbf911bb.json +++ b/persistence/sql/migratest/fixtures/settings_flow/74fd6c53-7651-453e-90b8-2c5adbf911bb.json @@ -1,5 +1,6 @@ { "id": "74fd6c53-7651-453e-90b8-2c5adbf911bb", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/settings", diff --git a/persistence/sql/migratest/fixtures/settings_request/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json b/persistence/sql/migratest/fixtures/settings_flow/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json similarity index 95% rename from persistence/sql/migratest/fixtures/settings_request/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json rename to persistence/sql/migratest/fixtures/settings_flow/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json index c8c9bf8d2d5..02be4bb21de 100644 --- a/persistence/sql/migratest/fixtures/settings_request/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json +++ b/persistence/sql/migratest/fixtures/settings_flow/77fe4fb3-2d4e-4532-b568-c44b0aece0aa.json @@ -1,5 +1,6 @@ { "id": "77fe4fb3-2d4e-4532-b568-c44b0aece0aa", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/settings", diff --git a/persistence/sql/migratest/fixtures/settings_request/a79bfcf1-68ae-49de-8b23-4f96921b8341.json b/persistence/sql/migratest/fixtures/settings_flow/a79bfcf1-68ae-49de-8b23-4f96921b8341.json similarity index 95% rename from persistence/sql/migratest/fixtures/settings_request/a79bfcf1-68ae-49de-8b23-4f96921b8341.json rename to persistence/sql/migratest/fixtures/settings_flow/a79bfcf1-68ae-49de-8b23-4f96921b8341.json index 1cdaded4543..8e08ca68498 100644 --- a/persistence/sql/migratest/fixtures/settings_request/a79bfcf1-68ae-49de-8b23-4f96921b8341.json +++ b/persistence/sql/migratest/fixtures/settings_flow/a79bfcf1-68ae-49de-8b23-4f96921b8341.json @@ -1,5 +1,6 @@ { "id": "a79bfcf1-68ae-49de-8b23-4f96921b8341", + "type": "browser", "expires_at": "2013-10-07T08:23:19Z", "issued_at": "2013-10-07T08:23:19Z", "request_url": "http://kratos:4433/self-service/browser/flows/settings", diff --git a/persistence/sql/migratest/fixtures/settings_flow/cdfd1eed-34a4-491d-ad0a-7579d3a0a7ba.json b/persistence/sql/migratest/fixtures/settings_flow/cdfd1eed-34a4-491d-ad0a-7579d3a0a7ba.json new file mode 100644 index 00000000000..eb934218b48 --- /dev/null +++ b/persistence/sql/migratest/fixtures/settings_flow/cdfd1eed-34a4-491d-ad0a-7579d3a0a7ba.json @@ -0,0 +1,19 @@ +{ + "id": "cdfd1eed-34a4-491d-ad0a-7579d3a0a7ba", + "type": "browser", + "expires_at": "2013-10-07T08:23:19Z", + "issued_at": "2013-10-07T08:23:19Z", + "request_url": "http://kratos:4433/self-service/browser/flows/settings", + "active": "profile", + "messages": [], + "methods": {}, + "identity": { + "id": "a251ebc2-880c-4f76-a8f3-38e6940eab0e", + "schema_id": "default", + "schema_url": "", + "traits": { + "email": "foobar@ory.sh" + } + }, + "state": "show_form" +} \ No newline at end of file diff --git a/persistence/sql/migratest/migration_refresh_test.go b/persistence/sql/migratest/migration_refresh_test.go new file mode 100644 index 00000000000..a9ade23c382 --- /dev/null +++ b/persistence/sql/migratest/migration_refresh_test.go @@ -0,0 +1,18 @@ +// +build refresh + +package migratest + +import ( + "testing" + "encoding/json" + "io/ioutil" + + "github.com/stretchr/testify/require" +) + +func writeFixtureOnError(t *testing.T, err error, actual interface{}, location string) { + content, err := json.MarshalIndent(actual, "", " ") + require.NoError(t, err) + require.NoError(t, ioutil.WriteFile(location, content, 0666)) + +} diff --git a/persistence/sql/migratest/migration_strict_test.go b/persistence/sql/migratest/migration_strict_test.go new file mode 100644 index 00000000000..1fee9b76d55 --- /dev/null +++ b/persistence/sql/migratest/migration_strict_test.go @@ -0,0 +1,13 @@ +// +build !refresh + +package migratest + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func writeFixtureOnError(t *testing.T, err error, actual interface{}, location string) { + require.NoError(t, err) +} diff --git a/persistence/sql/migratest/migration_test.go b/persistence/sql/migratest/migration_test.go index fbfbc1bedf3..93a1462bdae 100644 --- a/persistence/sql/migratest/migration_test.go +++ b/persistence/sql/migratest/migration_test.go @@ -9,7 +9,6 @@ import ( "os" "path/filepath" "runtime/debug" - "strconv" "testing" "github.com/sirupsen/logrus" @@ -127,7 +126,7 @@ func TestMigrations(t *testing.T) { for _, id := range ids { actual, err := d.Registry().LoginFlowPersister().GetLoginFlow(context.Background(), id.ID) require.NoError(t, err) - compareWithFixture(t, actual, "login_request", id.ID.String()) + compareWithFixture(t, actual, "login_flow", id.ID.String()) } }) t.Run("case=registration", func(t *testing.T) { @@ -137,28 +136,28 @@ func TestMigrations(t *testing.T) { for _, id := range ids { actual, err := d.Registry().RegistrationFlowPersister().GetRegistrationFlow(context.Background(), id.ID) require.NoError(t, err) - compareWithFixture(t, actual, "registration_request", id.ID.String()) + compareWithFixture(t, actual, "registration_flow", id.ID.String()) } }) - t.Run("case=settings_request", func(t *testing.T) { + t.Run("case=settings_flow", func(t *testing.T) { var ids []settings.Flow require.NoError(t, c.Select("id").All(&ids)) for _, id := range ids { actual, err := d.Registry().SettingsFlowPersister().GetSettingsFlow(context.Background(), id.ID) require.NoError(t, err) - compareWithFixture(t, actual, "settings_request", id.ID.String()) + compareWithFixture(t, actual, "settings_flow", id.ID.String()) } }) - t.Run("case=recovery_request", func(t *testing.T) { + t.Run("case=recovery_flow", func(t *testing.T) { var ids []recovery.Flow require.NoError(t, c.Select("id").All(&ids)) for _, id := range ids { actual, err := d.Registry().RecoveryFlowPersister().GetRecoveryFlow(context.Background(), id.ID) require.NoError(t, err) - compareWithFixture(t, actual, "recovery_request", id.ID.String()) + compareWithFixture(t, actual, "recovery_flow", id.ID.String()) } }) }) @@ -195,12 +194,3 @@ func compareWithFixture(t *testing.T, actual interface{}, prefix string, id stri writeFixtureOnError(t, nil, actual, location) } } - -func writeFixtureOnError(t *testing.T, err error, actual interface{}, location string) { - if ok, _ := strconv.ParseBool(os.Getenv("REFRESH_FIXTURES")); ok { - content, err := json.MarshalIndent(actual, "", " ") - require.NoError(t, err) - require.NoError(t, ioutil.WriteFile(location, content, 0666)) - } - require.NoError(t, err) -} diff --git a/persistence/sql/migratest/testdata/20200810141652_testdata.sql b/persistence/sql/migratest/testdata/20200810141652_testdata.sql index e69de29bb2d..dd750f7449b 100644 --- a/persistence/sql/migratest/testdata/20200810141652_testdata.sql +++ b/persistence/sql/migratest/testdata/20200810141652_testdata.sql @@ -0,0 +1,7 @@ +INSERT INTO selfservice_login_requests (id, request_url, issued_at, expires_at, active_method, csrf_token, created_at, updated_at, forced, messages, type) VALUES ('47edd3a8-0998-4779-9469-f4b8ee4430df', 'http://kratos:4433/self-service/browser/flows/login', '2013-10-07 08:23:19', '2013-10-07 08:23:19', '', 'fpeVSZ9ZH7YvUkhXsOVEIssxbfauh5lcoQSYxTcN0XkMneg1L42h+HtvisjlNjBF4ElcD2jApCHoJYq2u9sVWg==', '2013-10-07 08:23:19', '2013-10-07 08:23:19', false, '[]', 'api'); +INSERT INTO selfservice_registration_requests (id, request_url, issued_at, expires_at, active_method, csrf_token, created_at, updated_at, messages, type) VALUES ('696e7022-c466-44f6-89c6-8cf93c06a62a', 'http://kratos:4433/self-service/browser/flows/registration', '2013-10-07 08:23:19', '2013-10-07 08:23:19', 'password', 'vYYuhWXBfXKzBC+BlnbDmXfBKsUWY6SU/v04gHF9GYzPjFP51RXDPOc57R7Dpbf+XLkbPNAkmem33Crz/avdrw==', '2013-10-07 08:23:19', '2013-10-07 08:23:19', '[]', 'api'); +INSERT INTO selfservice_verification_requests (id, request_url, issued_at, expires_at, form, via, csrf_token, success, created_at, updated_at, messages, type) VALUES ('3631e880-ce59-4cbd-a705-0d825eea590d', 'http://kratos:4433/self-service/browser/flows/verification/email', '2013-10-07 08:23:19', '2013-10-07 08:23:19', 'null', 'email', '8xoIMa1+UkDqTt+tIHmIEHztQkk0AWk2PJhWWYDmB6dSE+RtJinnxtwH5lNNCnYyQuCF2ugy7rWjCgiwYPJNOw==', true, '2013-10-07 08:23:19', '2013-10-07 08:23:19', '[]', 'api'); +INSERT INTO selfservice_settings_requests (id, request_url, issued_at, expires_at, state, identity_id, created_at, updated_at, active_method, messages) VALUES +('cdfd1eed-34a4-491d-ad0a-7579d3a0a7ba', 'http://kratos:4433/self-service/browser/flows/settings', '2013-10-07 08:23:19', '2013-10-07 08:23:19', 'show_form', 'a251ebc2-880c-4f76-a8f3-38e6940eab0e', '2013-10-07 08:23:19', '2013-10-07 08:23:19', 'profile', '[]'); +INSERT INTO selfservice_recovery_requests (id, request_url, issued_at, expires_at, messages, active_method, csrf_token, state, recovered_identity_id, created_at, updated_at, type) +VALUES ('87e871e1-a45f-4ed0-ba4e-a03063c774dc', 'http://kratos:4433/self-service/browser/flows/registration', '2013-10-07 08:23:19', '2013-10-07 08:23:19', '[]', 'link', 'vYYuhWXBfXKzBC+BlnbDmXfBKsUWY6SU/v04gHF9GYzPjFP51RXDPOc57R7Dpbf+XLkbPNAkmem33Crz/avdrw==', 'choose_method', 'a251ebc2-880c-4f76-a8f3-38e6940eab0e', '2013-10-07 08:23:19', '2013-10-07 08:23:19', 'api');