-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NET-4984: Update APIGW Config Entries for JWT Auth #18366
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ce4d50e
Added oss config entries for Policy and JWT on APIGW
jm96441n 8c3a07a
Updated structs for config entry
jm96441n 816b47f
Updated comments, ran deep-copy
jm96441n 2879b99
Move JWT configuration into OSS file
jm96441n 20cfcf9
Add in the config entry OSS file for jwts
jm96441n 7c21848
Added changelog
jm96441n 0bf2f5e
fixing proto spacing
jm96441n ce2aacc
Moved to using manually written deep copy method
jm96441n 886a0c5
Merge branch 'main' into NET-4984-apigw-config-entry-jwt
jm96441n 010279a
Use pointers for override/default fields in apigw config entries
jm96441n ce5dc85
Merge branch 'main' into NET-4984-apigw-config-entry-jwt
jm96441n b223c1a
Run gen scripts for changed types
jm96441n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,3 @@ | ||
```release-note:feature | ||
config-entry(api-gateway): (Enterprise only) Add GatewayPolicy to APIGateway Config Entry listeners | ||
``` |
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,10 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
//go:build !consulent | ||
// +build !consulent | ||
|
||
package structs | ||
|
||
// APIGatewayJWTRequirement holds the list of JWT providers to be verified against | ||
type APIGatewayJWTRequirement struct{} |
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,6 @@ | ||
package structs | ||
|
||
// DeepCopy generates a deep copy of *APIGatewayJWTRequirement | ||
func (o *APIGatewayJWTRequirement) DeepCopy() *APIGatewayJWTRequirement { | ||
return new(APIGatewayJWTRequirement) | ||
} |
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 |
---|---|---|
|
@@ -8,12 +8,14 @@ import ( | |
"fmt" | ||
"io" | ||
"os" | ||
"strings" | ||
"time" | ||
|
||
"github.com/mitchellh/mapstructure" | ||
|
||
"github.com/hashicorp/consul/api" | ||
"github.com/hashicorp/consul/lib/decode" | ||
"github.com/hashicorp/go-multierror" | ||
"github.com/mitchellh/mapstructure" | ||
) | ||
|
||
func loadFromFile(path string) (string, error) { | ||
|
@@ -124,13 +126,19 @@ func newDecodeConfigEntry(raw map[string]interface{}) (api.ConfigEntry, error) { | |
} | ||
|
||
for _, k := range md.Unused { | ||
switch k { | ||
case "kind", "Kind": | ||
switch { | ||
case strings.ToLower(k) == "kind": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed this up so that the error messaging would be the same whether doing a |
||
// The kind field is used to determine the target, but doesn't need | ||
// to exist on the target. | ||
continue | ||
|
||
case strings.HasSuffix(strings.ToLower(k), "namespace"): | ||
err = multierror.Append(err, fmt.Errorf("invalid config key %q, namespaces are a consul enterprise feature", k)) | ||
case strings.Contains(strings.ToLower(k), "jwt"): | ||
err = multierror.Append(err, fmt.Errorf("invalid config key %q, api-gateway jwt validation is a consul enterprise feature", k)) | ||
default: | ||
err = multierror.Append(err, fmt.Errorf("invalid config key %q", k)) | ||
} | ||
err = multierror.Append(err, fmt.Errorf("invalid config key %q", k)) | ||
} | ||
if err != nil { | ||
return nil, err | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good add, m8!