mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-25 22:24:58 +09:00
Unit tests mock the API server and the store, so nothing shows that the console's nginx, the proxy's TokenReview and SubjectAccessReview and a real VictoriaLogs agree. The suite drives a viewer of one tenant through the console against a seeded store: it reads its own namespace, is refused a sibling's, cannot widen the scope with client filters, an AccountID header or dot segments, and keeps a tail open past a minute. The root store is off in e2e, so the suite runs its own VictoriaLogs under the root store's Service name rather than waiting on Fluent Bit. Assisted-by: LLM Signed-off-by: ZverGuy <maximbel2003@gmail.com>
23 lines
625 B
YAML
23 lines
625 B
YAML
# The view level of tenant A and nothing else: a ServiceAccount of tenant A
|
|
# bound to cozy:tenant:view in A's namespace only. Its token is a real bearer
|
|
# token, so the proxy's TokenReview and SubjectAccessReview run unmocked.
|
|
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: logs-viewer
|
|
namespace: tenant-test-logsa
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: logs-viewer
|
|
namespace: tenant-test-logsa
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: cozy:tenant:view
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: logs-viewer
|
|
namespace: tenant-test-logsa
|