-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Configmap configuration * Add config helper and usage in validation and generation of resources * Fix tests * Validate test config * Reindex some internal comments
- Loading branch information
Showing
17 changed files
with
236 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config | ||
data: | ||
api-gateway-config.yaml: > | ||
jwtHandler: "ory" |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- configmap.yaml |
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 |
---|---|---|
|
@@ -386,4 +386,4 @@ spec: | |
served: true | ||
storage: true | ||
subresources: | ||
status: {} | ||
status: {} |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package helpers | ||
|
||
import ( | ||
"io/ioutil" | ||
|
||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
const JWT_HANDLER_ORY = "ory" | ||
const JWT_HANDLER_ISTIO = "istio" | ||
|
||
const CONFIG_FILE = "/api-gateway-config.yaml" | ||
|
||
var ReadFileHandle = ioutil.ReadFile | ||
|
||
type Config struct { | ||
JWTHandler string `yaml:"jwtHandler"` | ||
} | ||
|
||
func LoadConfig() (*Config, error) { | ||
configData, err := ReadFileHandle(CONFIG_FILE) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
config := &Config{} | ||
err = yaml.Unmarshal(configData, config) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return config, err | ||
} |
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,10 +1,13 @@ | ||
package validation | ||
|
||
import gatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1" | ||
import ( | ||
gatewayv1beta1 "github.com/kyma-incubator/api-gateway/api/v1beta1" | ||
"github.com/kyma-incubator/api-gateway/internal/helpers" | ||
) | ||
|
||
// dummy is an accessStrategy validator that does nothing | ||
type dummyAccStrValidator struct{} | ||
|
||
func (dummy *dummyAccStrValidator) Validate(attrPath string, handler *gatewayv1beta1.Handler) []Failure { | ||
func (dummy *dummyAccStrValidator) Validate(attrPath string, handler *gatewayv1beta1.Handler, config *helpers.Config) []Failure { | ||
return nil | ||
} |
Oops, something went wrong.