55package authn
66
77import (
8+ "crypto/rsa"
89 "strconv"
910 "time"
1011
2627 Level string `json:"level"`
2728 }
2829 NetConf struct {
29- HTTP HTTPConf `json:"http"`
30+ ExternalURL string `json:"external_url"`
31+ HTTP HTTPConf `json:"http"`
3032 }
3133 HTTPConf struct {
3234 Certificate string `json:"server_crt"`
@@ -35,11 +37,14 @@ type (
3537 UseHTTPS bool `json:"use_https"`
3638 }
3739 ServerConf struct {
38- psecret * string `json:"-"`
39- pexpire * cos.Duration `json:"-"`
40- Secret string `json:"secret"`
41- Expire cos.Duration `json:"expiration_time"`
42- PubKey * string `json:"public_key"`
40+ psecret * string `json:"-"`
41+ pexpire * cos.Duration `json:"-"`
42+ pKey * rsa.PrivateKey `json:"-"`
43+ Secret string `json:"secret"`
44+ // Determines when the secret or key expires
45+ // Also used to determine max-age for client caches of JWKS
46+ Expire cos.Duration `json:"expiration_time"`
47+ PubKey * string `json:"public_key"`
4348 }
4449 TimeoutConf struct {
4550 Default cos.Duration `json:"default_timeout"`
@@ -81,5 +86,7 @@ func (c *Config) Verbose() bool {
8186 return level > 3
8287}
8388
84- func (c * Config ) Secret () cmn.Censored { return cmn .Censored (* c .Server .psecret ) }
85- func (c * Config ) Expire () time.Duration { return time .Duration (* c .Server .pexpire ) }
89+ func (c * Config ) SetPrivateKey (key * rsa.PrivateKey ) { c .Server .pKey = key }
90+ func (c * Config ) GetPrivateKey () * rsa.PrivateKey { return c .Server .pKey }
91+ func (c * Config ) Secret () cmn.Censored { return cmn .Censored (* c .Server .psecret ) }
92+ func (c * Config ) Expire () time.Duration { return time .Duration (* c .Server .pexpire ) }
0 commit comments