-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/s390x-arch
- Loading branch information
Showing
113 changed files
with
4,229 additions
and
2,212 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,3 +1,5 @@ | ||
/ci/ @TykTechnologies/devops | ||
.github/workflows/release.yml @TykTechnologies/devops | ||
.github/workflows/sync-automation.yml @TykTechnologies/devops | ||
.github/workflows/pac.yml @TykTechnologies/devops | ||
/repo-policy/ @TykTechnologies/devops |
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
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,23 @@ | ||
# Keep the docs on tyk-docs in sync with this branch's docs | ||
|
||
name: Update Config docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-** | ||
paths: | ||
- config/config.go | ||
|
||
jobs: | ||
sync: | ||
name: tyk-config-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.ORG_GH_TOKEN }} | ||
repository: TykTechnologies/tyk-docs | ||
event-type: tyk-config-docs | ||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}","repo":"gateway","branch":"${{github.ref_name}}"}' |
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,56 @@ | ||
package gqlengineadapter | ||
|
||
import ( | ||
"net/http" | ||
"strings" | ||
|
||
graphqlDataSource "github.com/TykTechnologies/graphql-go-tools/pkg/engine/datasource/graphql_datasource" | ||
"github.com/TykTechnologies/graphql-go-tools/pkg/graphql" | ||
|
||
"github.com/TykTechnologies/tyk/apidef" | ||
) | ||
|
||
type ProxyOnly struct { | ||
ApiDefinition *apidef.APIDefinition | ||
HttpClient *http.Client | ||
StreamingClient *http.Client | ||
Schema *graphql.Schema | ||
|
||
subscriptionClientFactory graphqlDataSource.GraphQLSubscriptionClientFactory | ||
} | ||
|
||
func (p *ProxyOnly) EngineConfig() (*graphql.EngineV2Configuration, error) { | ||
var err error | ||
if p.Schema == nil { | ||
p.Schema, err = parseSchema(p.ApiDefinition.GraphQL.Schema) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
staticHeaders := make(http.Header) | ||
|
||
url := p.ApiDefinition.Proxy.TargetURL | ||
if strings.HasPrefix(url, "tyk://") { | ||
url = strings.ReplaceAll(url, "tyk://", "http://") | ||
staticHeaders.Set(apidef.TykInternalApiHeader, "true") | ||
} | ||
|
||
upstreamConfig := graphql.ProxyUpstreamConfig{ | ||
URL: url, | ||
StaticHeaders: staticHeaders, | ||
SubscriptionType: graphqlSubscriptionType(p.ApiDefinition.GraphQL.Proxy.SubscriptionType), | ||
} | ||
|
||
v2Config, err := graphql.NewProxyEngineConfigFactory( | ||
p.Schema, | ||
upstreamConfig, | ||
graphqlDataSource.NewBatchFactory(), | ||
graphql.WithProxyHttpClient(p.HttpClient), | ||
graphql.WithProxyStreamingClient(p.StreamingClient), | ||
graphql.WithProxySubscriptionClientFactory(subscriptionClientFactoryOrDefault(p.subscriptionClientFactory)), | ||
).EngineV2Configuration() | ||
|
||
v2Config.EnableSingleFlight(true) | ||
return &v2Config, err | ||
} |
Oops, something went wrong.