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

Refactor selfservice modules and add profile management #126

Merged
merged 8 commits into from
Dec 1, 2019
Merged

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Nov 22, 2019

This patch adds profile management ( closes #112 ) and many internals have been refactored as a preparation for implementing that flow:

  • Flows (login, registration, profile management) have been decoupled and moved to selfservice/flows/<flow>
  • The form parser has been reworked completely and now uses JSON for types assertions everywhere.
  • The JSON Schema custom keyword was renamed to ory.sh/kratos - closes Decide JSON Schema custom keyword prefix for custom logic #115
  • The persistence layer has completely been refactored, reducing duplication.

This patch adds profile management ( closes #112 ) and many internals have been refactored as a preparation for implementing that flow:

- Flows (login, registration, profile management) have been decoupled and moved to selfservice/flows/<flow>
- The form parser has been reworked completely and now uses JSON for types assertions everywhere.
aeneasr and others added 3 commits November 23, 2019 13:48
This patch completes the profile management flow by implementing proper error and success states and adding several data integrity tests.

Closes #112
This is a major refactoring of the internal DBAL. After a successful proof of concept and evaluation of gobuffalo/pop, we believe this to be the best DBAL for Go at the moment. It abstracts a lot of boilerplate code away.

As with all sophisticated DBALs, pop too has its quirks. There are several issues that have been discovered during testing and adoption: gobuffalo/pop#136 gobuffalo/pop#476 gobuffalo/pop#473 gobuffalo/pop#469 gobuffalo/pop#466

However, the upside of moving much of the hard database/sql plumbing into another library cleans up the code base significantly and reduces complexity.

As part of this change, the "ephermal" DBAL ("in memory") will be removed and sqlite will be used instead. This further reduces complexity of the code base and code-duplication.

To support sqlite, CGO is required, which means that we need to run tests with `go test -tags sqlite` on a machine that has g++ installed. This also means that we need a Docker Image with `alpine` as opposed to pure `scratch`. While this is certainly a downside, the upside of less maintenance and "free" support for SQLite, PostgreSQL, MySQL, and CockroachDB simply outweighs any downsides that come with CGO.
@aeneasr aeneasr marked this pull request as ready for review December 1, 2019 20:22
@aeneasr aeneasr merged commit 21d08b8 into master Dec 1, 2019
@aeneasr aeneasr deleted the close-112 branch December 1, 2019 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide JSON Schema custom keyword prefix for custom logic Implement selfservice profile management
1 participant