-
Notifications
You must be signed in to change notification settings - Fork 937
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Flowpilot - integration (#1532)
This pull request introduces the new Flowpilot system along with several new features and various improvements. The key enhancements include configurable authorization, registration, and profile flows, as well as the ability to enable and disable user identifiers (e.g., email addresses and usernames) and login methods. --------- Co-authored-by: Frederic Jahn <[email protected]> Co-authored-by: Lennart Fleischmann <[email protected]> Co-authored-by: lfleischmann <[email protected]> Co-authored-by: merlindru <[email protected]>
- Loading branch information
1 parent
f56c6b9
commit 601ffaa
Showing
453 changed files
with
17,959 additions
and
23,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Generate config reference markdown | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
config: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20' | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.16.0' | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Checkout backend | ||
uses: actions/checkout@v4 | ||
with: | ||
path: hanko | ||
|
||
- name: Checkout backend wiki | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{github.repository}}.wiki | ||
path: wiki | ||
|
||
- name: Generate config docs | ||
working-directory: ./hanko/backend | ||
run: | | ||
go generate ./... | ||
go run main.go schema json2md | ||
- name: Clean md file endings | ||
working-directory: ./hanko/backend | ||
run: | | ||
find ./docs/.generated/config/md -type f -name "*.md" -exec sed -i "s/\.md//g" "{}" \; | ||
- name: Copy generated files | ||
working-directory: ./hanko/backend | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/wiki/reference/config | ||
rm $GITHUB_WORKSPACE/wiki/reference/config/*.md 2>/dev/null || true | ||
cp ./docs/.generated/config/md/*.md $GITHUB_WORKSPACE/wiki/reference/config | ||
- name: Commit and push to wiki | ||
working-directory: ./wiki | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "action: Autogenerate config reference docs" | ||
git push origin HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package schema | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"github.com/invopop/jsonschema" | ||
"github.com/spf13/cobra" | ||
"github.com/teamhanko/hanko/backend/config" | ||
"log" | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
func NewJson2MdCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "json2md", | ||
Short: "Generate markdown from JSONSchema", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
r := new(jsonschema.Reflector) | ||
r.DoNotReference = true | ||
if err := r.AddGoComments("github.com/teamhanko/hanko/backend", "./config"); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
if err := r.AddGoComments("github.com/teamhanko/hanko/backend", "./ee"); err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
s := r.Reflect(&config.Config{}) | ||
s.Title = "Config" | ||
|
||
data, err := json.MarshalIndent(s, "", " ") | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
outPath := "./docs/.generated/config" | ||
if _, err := os.Stat(outPath); errors.Is(err, os.ErrNotExist) { | ||
err := os.MkdirAll(outPath, 0750) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} | ||
|
||
err = os.WriteFile(fmt.Sprintf("%s/hanko.config.json", outPath), data, 0600) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
out, err := exec.Command("npx", | ||
"@adobe/jsonschema2md", | ||
"--input=docs/.generated/config", | ||
"--out=docs/.generated/config/md", | ||
"--schema-extension=config.json", | ||
"--example-format=yaml", | ||
"--header=false", | ||
"--skip=definedinfact", | ||
"--skip=typesection", | ||
"--schema-out=-", | ||
"--properties=format", | ||
"--no-readme=true"). | ||
CombinedOutput() | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Println(string(out)) | ||
}, | ||
} | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package schema | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
func NewSchemaCommand() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "schema", | ||
Short: "JSONSchema related commands", | ||
Long: ``, | ||
} | ||
} | ||
|
||
func RegisterCommands(parent *cobra.Command) { | ||
cmd := NewSchemaCommand() | ||
parent.AddCommand(cmd) | ||
cmd.AddCommand(NewJson2MdCommand()) | ||
} |
Oops, something went wrong.