Skip to content

Commit

Permalink
chore: cover credentials in KongClient golden tests
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Oct 29, 2024
1 parent daf8bb7 commit 0226f5b
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 0 deletions.
62 changes: 62 additions & 0 deletions internal/dataplane/testdata/golden/credentials/default_golden.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
_format_version: "3.0"
consumers:
- acls:
- group: group
tags:
- k8s-name:consumer-acl
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
basicauth_credentials:
- password: consumer-1-password
tags:
- k8s-name:consumer-basic-auth
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
username: consumer-1
hmacauth_credentials:
- tags:
- k8s-name:consumer-hmac-auth
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
username: consumer-1
id: 7deb6e70-60be-5dd2-b374-06551479ea5e
jwt_secrets:
- algorithm: HS256
key: key
tags:
- k8s-name:consumer-jwt
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
keyauth_credentials:
- key: key
tags:
- k8s-name:consumer-key-auth
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
mtls_auth_credentials:
- subject_name: subject
tags:
- k8s-name:consumer-mtls-auth
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
oauth2_credentials:
- client_id: client-id
name: consumer-1
tags:
- k8s-name:consumer-oauth2
- k8s-namespace:default
- k8s-kind:Secret
- k8s-version:v1
tags:
- k8s-name:consumer
- k8s-namespace:default
- k8s-kind:KongConsumer
- k8s-group:configuration.konghq.com
- k8s-version:v1
username: consumer
88 changes: 88 additions & 0 deletions internal/dataplane/testdata/golden/credentials/in.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
name: consumer
namespace: default
annotations:
kubernetes.io/ingress.class: kong
username: consumer
credentials:
- consumer-basic-auth
- consumer-key-auth
- consumer-hmac-auth
- consumer-oauth2
- consumer-jwt
- consumer-acl
- consumer-mtls-auth
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-key-auth
namespace: default
labels:
konghq.com/credential: key-auth
data:
key: "a2V5"
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-basic-auth
namespace: default
labels:
konghq.com/credential: basic-auth
data:
username: "Y29uc3VtZXItMQ=="
password: "Y29uc3VtZXItMS1wYXNzd29yZA=="
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-hmac-auth
namespace: default
labels:
konghq.com/credential: hmac-auth
data:
username: "Y29uc3VtZXItMQ=="
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-oauth2
namespace: default
labels:
konghq.com/credential: oauth2
data:
client_id: "Y2xpZW50LWlk"
name: "Y29uc3VtZXItMQ=="
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-jwt
namespace: default
labels:
konghq.com/credential: jwt
data:
key: "a2V5"
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-acl
namespace: default
labels:
konghq.com/credential: acl
data:
group: "Z3JvdXA="
---
apiVersion: v1
kind: Secret
metadata:
name: consumer-mtls-auth
namespace: default
labels:
konghq.com/credential: mtls-auth
data:
subject_name: "c3ViamVjdA=="

0 comments on commit 0226f5b

Please sign in to comment.