Skip to content

Commit

Permalink
Do not allow empty string in upstream auth configuration strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-mathew committed Nov 8, 2024
1 parent 36afb48 commit dc55397
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
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

0 comments on commit dc55397

Please sign in to comment.