-
-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
184 additions
and
73 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
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
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
package password | ||
|
||
import ( | ||
"github.com/markbates/pkger" | ||
|
||
"github.com/ory/kratos/x/pkgerx" | ||
"github.com/gobuffalo/packr/v2" | ||
) | ||
|
||
var loginSchema = pkgerx.MustRead(pkger.Open("/selfservice/strategy/password/.schema/login.schema.json")) | ||
var registrationSchema = pkgerx.MustRead(pkger.Open("/selfservice/strategy/password/.schema/registration.schema.json")) | ||
var schemas = packr.New(".schema", ".schema") | ||
var loginSchema, registrationSchema []byte | ||
|
||
func init() { | ||
var err error | ||
loginSchema, err = schemas.Find("login.schema.json") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
registrationSchema, err = schemas.Find("registration.schema.json") | ||
if err != nil { | ||
panic(err) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,23 +1,18 @@ | ||
package x | ||
|
||
import ( | ||
"io/ioutil" | ||
|
||
"github.com/markbates/pkger" | ||
|
||
"github.com/gobuffalo/packr/v2" | ||
"github.com/ory/x/logrusx" | ||
"github.com/ory/x/viperx" | ||
) | ||
|
||
var schemas = packr.New("schemas", "../.schema") | ||
|
||
func WatchAndValidateViper(log *logrusx.Logger) { | ||
file, err := pkger.Open("/.schema/config.schema.json") | ||
schema, err := schemas.Find("config.schema.json") | ||
if err != nil { | ||
log.WithError(err).Fatal("Unable to open configuration JSON Schema.") | ||
} | ||
defer file.Close() | ||
schema, err := ioutil.ReadAll(file) | ||
if err != nil { | ||
log.WithError(err).Fatal("Unable to read configuration JSON Schema.") | ||
} | ||
|
||
viperx.WatchAndValidateViper(log, schema, "ORY Kratos", []string{"serve", "profiling", "log"}, "") | ||
} |
This file was deleted.
Oops, something went wrong.