-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): integrate JWT secret into AppConfig and adjust config p…
…aths - Update 'config' package to set the config path to the current directory. - Refactor 'middlewares' to use JWT secret from 'config.GatekeeperConfig'. - Enhance 'models.AppConfig' to include 'JWTSecret'. - Add JWT secret key to the YAML configuration file.
- Loading branch information
1 parent
83cfcd9
commit b66f5c4
Showing
5 changed files
with
13 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ gates: | |
path: "/post" | ||
limit: 5 | ||
duration: 30 | ||
jwt_secret: "your-secret-key" |
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,16 +1,17 @@ | ||
package models | ||
|
||
type AppConfig struct { | ||
Gates []Gate `yaml:"gates"` | ||
JWTSecret string `mapstructure:"jwt_secret"` | ||
Gates []Gate `mapstructure:"gates"` | ||
} | ||
|
||
type Gate struct { | ||
Path string `yaml:"path"` | ||
Method string `yaml:"method"` | ||
Rules []Rule `yaml:"rules"` | ||
Path string `mapstructure:"path"` | ||
Method string `mapstructure:"method"` | ||
Rules []Rule `mapstructure:"rules"` | ||
} | ||
|
||
type Rule struct { | ||
Name string `yaml:"name"` | ||
Config interface{} `yaml:"config"` | ||
Name string `mapstructure:"name"` | ||
Config interface{} `mapstructure:"config"` | ||
} |