diff options
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/config.go b/config.go index b4e0754..7630e87 100644 --- a/config.go +++ b/config.go @@ -13,6 +13,10 @@ type Config struct { allowedPorts []int forbiddenPorts []int + + key string + + jwtSecret string } // GetConfig creates the Portgate config from outside sources such as @@ -25,6 +29,8 @@ func GetConfig() (Config, error) { allowedPorts: []int{80}, forbiddenPorts: []int{}, + + key: "password", }, nil } @@ -43,3 +49,8 @@ func (c *Config) MakeUrl(p Path) string { // TODO: Figure out what to do with TLS return fmt.Sprintf("http://%s:%d%s", c.targetHost, p.DestinationIdentifier, p.ResourcePath) } + +// CheckKey checks whether the givenKey matches the one in the config. +func (c *Config) CheckKey(givenKey string) bool { + return c.key == givenKey +} |
