mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Refactored token options
This commit is contained in:
parent
084a49d09f
commit
a667307654
1 changed files with 17 additions and 9 deletions
|
|
@ -40,6 +40,13 @@ type Endpoints struct {
|
||||||
Register string `yaml:"register"`
|
Register string `yaml:"register"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TokenOptions struct {
|
||||||
|
Duration time.Duration `yaml:"duration"`
|
||||||
|
Forwarding bool `yaml:"forwarding"`
|
||||||
|
Refresh bool `yaml:"refresh"`
|
||||||
|
Scope []string `yaml:"scope"`
|
||||||
|
}
|
||||||
|
|
||||||
type Authentication struct {
|
type Authentication struct {
|
||||||
Clients []oauth.Client `yaml:"clients"`
|
Clients []oauth.Client `yaml:"clients"`
|
||||||
Flows Flows `yaml:"flows"`
|
Flows Flows `yaml:"flows"`
|
||||||
|
|
@ -50,9 +57,7 @@ type Authentication struct {
|
||||||
type Authorization struct {
|
type Authorization struct {
|
||||||
Endpoints Endpoints `yaml:"endpoints"`
|
Endpoints Endpoints `yaml:"endpoints"`
|
||||||
KeyPath string `yaml:"key-path"`
|
KeyPath string `yaml:"key-path"`
|
||||||
TokenDuration time.Duration `yaml:"token-duration"`
|
Token TokenOptions `yaml:"token"`
|
||||||
TokenForwarding bool `yaml:"token-forwarding"`
|
|
||||||
TokenRefresh bool `yaml:"refresh"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
@ -84,9 +89,12 @@ func NewConfig() Config {
|
||||||
},
|
},
|
||||||
Authorization: Authorization{
|
Authorization: Authorization{
|
||||||
KeyPath: "./keys",
|
KeyPath: "./keys",
|
||||||
TokenForwarding: false,
|
Token: TokenOptions{
|
||||||
TokenDuration: 1 * time.Hour,
|
Forwarding: false,
|
||||||
TokenRefresh: true,
|
Duration: 1 * time.Hour,
|
||||||
|
Refresh: true,
|
||||||
|
Scope: []string{},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue