Skip to content

Commit d91305b

Browse files
authored
cmd: resolve issuer test issue (#522)
1 parent 2de9bd8 commit d91305b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

cmd/host.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ OAUTH2 CONTROLS
7676
- CONSENT_URL: The uri of the consent endpoint.
7777
Example: CONSENT_URL=https://id.myapp.com/consent
7878
79-
- ISSUER: The issuer is used for identification in all OAuth2 tokens. Should be the public url of the server.
80-
Defaults to ISSUER=http://localhost:4444
79+
- ISSUER: Issuer is the public URL of your Hydra installation. It is used for OAuth2 and OpenID Connect and must be
80+
specified and using HTTPS protocol, unless --dangerous-force-http is set.
81+
Example: ISSUER=https://hydra.myapp.com/
8182
8283
- AUTH_CODE_LIFESPAN: Lifespan of OAuth2 authorize codes. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
8384
Defaults to AUTH_CODE_LIFESPAN=10m

cmd/root_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestExecute(t *testing.T) {
2020
var path = filepath.Join(os.TempDir(), fmt.Sprintf("hydra-%s.yml", uuid.New()))
2121
os.Setenv("DATABASE_URL", "memory")
2222
os.Setenv("FORCE_ROOT_CLIENT_CREDENTIALS", "admin:pw")
23+
os.Setenv("ISSUER", "https://localhost:4444/")
2324
copy(osArgs, os.Args)
2425

2526
for _, c := range []struct {

cmd/server/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ func RunHost(c *config.Config) func(cmd *cobra.Command, args []string) {
4040

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

0 commit comments

Comments
 (0)