Skip to content

Commit

Permalink
cmd: resolve issuer test issue (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored Jun 14, 2017
1 parent 2de9bd8 commit d91305b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cmd/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ OAUTH2 CONTROLS
- CONSENT_URL: The uri of the consent endpoint.
Example: CONSENT_URL=https://id.myapp.com/consent
- ISSUER: The issuer is used for identification in all OAuth2 tokens. Should be the public url of the server.
Defaults to ISSUER=http://localhost:4444
- ISSUER: Issuer is the public URL of your Hydra installation. It is used for OAuth2 and OpenID Connect and must be
specified and using HTTPS protocol, unless --dangerous-force-http is set.
Example: ISSUER=https://hydra.myapp.com/
- AUTH_CODE_LIFESPAN: Lifespan of OAuth2 authorize codes. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Defaults to AUTH_CODE_LIFESPAN=10m
Expand Down
1 change: 1 addition & 0 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestExecute(t *testing.T) {
var path = filepath.Join(os.TempDir(), fmt.Sprintf("hydra-%s.yml", uuid.New()))
os.Setenv("DATABASE_URL", "memory")
os.Setenv("FORCE_ROOT_CLIENT_CREDENTIALS", "admin:pw")
os.Setenv("ISSUER", "https://localhost:4444/")
copy(osArgs, os.Args)

for _, c := range []struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func RunHost(c *config.Config) func(cmd *cobra.Command, args []string) {

if !c.ForceHTTP {
if c.Issuer == "" {
logger.Fatalln("Issuer must be explicitly specified unless --dangerous-force-http is passed.")
logger.Fatalln("Issuer must be explicitly specified unless --dangerous-force-http is passed. To find out more, use `hydra help host`.")
}
issuer, err := url.Parse(c.Issuer)
pkg.Must(err, "Could not parse issuer URL: %s", err)
if issuer.Scheme != "https" {
logger.Fatalln("Issuer must use HTTPS unless --dangerous-force-http is passed.")
logger.Fatalln("Issuer must use HTTPS unless --dangerous-force-http is passed. To find out more, use `hydra help host`.")
}
}

Expand Down

0 comments on commit d91305b

Please sign in to comment.