Skip to content
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

[TT-13422] Do not allow empty string in upstream auth configuration strings #6699

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions apidef/oas/schema/x-tyk-api-gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"type": "boolean"
},
"name": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
}
},
"required": [
Expand Down Expand Up @@ -2026,10 +2026,10 @@
"$ref": "#/definitions/X-Tyk-AuthSource"
},
"username": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"password": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
}
},
"required": [
Expand Down Expand Up @@ -2062,13 +2062,13 @@
"type": "object",
"properties": {
"clientId": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"clientSecret": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"tokenUrl": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"scopes": {
"type": [
Expand Down Expand Up @@ -2096,13 +2096,13 @@
"type": "object",
"properties": {
"clientId": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"clientSecret": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"tokenUrl": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"scopes": {
"type": [
Expand All @@ -2111,10 +2111,10 @@
]
},
"username": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"password": {
"type": "string"
"$ref": "#/definitions/X-Tyk-NonEmptyString"
},
"header": {
"$ref": "#/definitions/X-Tyk-AuthSource"
Expand All @@ -2139,7 +2139,10 @@
"enabled",
"allowedAuthorizeTypes"
]
},
"X-Tyk-NonEmptyString": {
"type": "string",
"pattern": "\\S+"
}

}
}
3 changes: 0 additions & 3 deletions apidef/oas/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,9 +694,6 @@ type ClientCredentials struct {
TokenURL string `bson:"tokenUrl" json:"tokenUrl"`
// Scopes specifies optional requested permissions.
Scopes []string `bson:"scopes,omitempty" json:"scopes,omitempty"`
// HeaderName is the custom header name to be used for OAuth client credential flow authentication.
// Defaults to `Authorization`.
HeaderName string `bson:"headerName" json:"headerName"`
// ExtraMetadata holds the keys that we want to extract from the token and pass to the upstream.
ExtraMetadata []string `bson:"extraMetadata" json:"extraMetadata,omitempty"`
}
Expand Down
Loading