Skip to content

Commit

Permalink
Revert "Add integration test for audience validation"
Browse files Browse the repository at this point in the history
This reverts commit eeeb6c1.
  • Loading branch information
Tharsanan1 committed Mar 5, 2024
1 parent 8f63c99 commit 3610265
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 109 deletions.
3 changes: 1 addition & 2 deletions idp/idp-domain-service/ballerina/TokenUtil.bal
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public class TokenUtil {
keyId: issuerConfiguration.keyId,
signatureConfig: {
config: {keyFile: idpConfiguration.keyStores.signing.keyFile}
},
audience: "aud1"
}
};
if username is string {
issuerConfig.username = username;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,47 +92,7 @@ var ResourceLevelJWT = suite.IntegrationTest{
},
Backend: "infra-backend-v1",
Namespace: ns,
Response: http.Response{StatusCode: 401},
},
// Test wrong audience
{
Request: http.Request{
Host: "resource-level-jwt.test.gw.wso2.com",
Path: "/resource-level-jwt/v1.0.0/v2/echo-1",
Headers: map[string]string{
"content-type": "application/json",
"internal-key": token,
},
Method: "GET",
},
ExpectedRequest: &http.ExpectedRequest{
Request: http.Request{
Path: "/v2/echo-1",
},
},
Backend: "infra-backend-v1",
Namespace: ns,
Response: http.Response{StatusCode: 401},
},
// Test correct audience
{
Request: http.Request{
Host: "resource-level-jwt.test.gw.wso2.com",
Path: "/resource-level-jwt/v1.0.0/v2/echo-2",
Headers: map[string]string{
"content-type": "application/json",
"internal-key": token,
},
Method: "GET",
},
ExpectedRequest: &http.ExpectedRequest{
Request: http.Request{
Path: "/v2/echo-2",
},
},
Backend: "infra-backend-v1",
Namespace: ns,
Response: http.Response{StatusCode: 200},
Response: http.Response{StatusCode: 401},
},
}
for i := range testCases {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,6 @@ spec:
group: dp.wso2.com
kind: Authentication
name: resource-level-jwt-authentication
- matches:
- path:
type: PathPrefix
value: /v2/echo-1
backendRefs:
- group: dp.wso2.com
kind: Backend
name: infra-backend-v1
filters:
- type: ExtensionRef
extensionRef:
group: dp.wso2.com
kind: Authentication
name: resource-level-jwt-authentication-1
- matches:
- path:
type: PathPrefix
value: /v2/echo-2
backendRefs:
- group: dp.wso2.com
kind: Backend
name: infra-backend-v1
filters:
- type: ExtensionRef
extensionRef:
group: dp.wso2.com
kind: Authentication
name: resource-level-jwt-authentication-2
---
apiVersion: dp.wso2.com/v1alpha2
kind: Authentication
Expand All @@ -106,44 +78,6 @@ spec:
group: gateway.networking.k8s.io
namespace: gateway-integration-test-infra
---
apiVersion: dp.wso2.com/v1alpha2
kind: Authentication
metadata:
name: resource-level-jwt-authentication-1
namespace: gateway-integration-test-infra
spec:
override:
disabled: false
authTypes:
jwt:
disabled: false
audience:
- "test"
targetRef:
kind: Resource
name: resource-level-jwt
group: gateway.networking.k8s.io
namespace: gateway-integration-test-infra
---
apiVersion: dp.wso2.com/v1alpha2
kind: Authentication
metadata:
name: resource-level-jwt-authentication-2
namespace: gateway-integration-test-infra
spec:
override:
disabled: false
authTypes:
jwt:
disabled: false
audience:
- "aud1"
targetRef:
kind: Resource
name: resource-level-jwt
group: gateway.networking.k8s.io
namespace: gateway-integration-test-infra
---
apiVersion: dp.wso2.com/v1alpha1
kind: Backend
metadata:
Expand Down

0 comments on commit 3610265

Please sign in to comment.