-
Notifications
You must be signed in to change notification settings - Fork 40
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
fix: retrieving groups from header values #306
Conversation
I see changes in code |
@prometherion , its working in case , it impersonating groups
So after impersonating I getting rate limiting errors, and its stop working
Maybe some optimization needed? like use only group defined in tenant or filter unneccessary in some way? |
I am also try to use --ignored-user-group= |
Do you have any update on this pull request ? For the rate limiting issue you encounter i was wondering if checking that impersonation is valid at capsule proxy is needed as as far as i understand, capsule proxy will forward this information to retrieve the needed resources to K8s that will check anyway that impersonation is valid. Am i wrong ? |
I don't think it will solve the issue. Maybe it could be worth using the Flow Control feature, besides exposing the client settings. I would stick only to one problem per time, so we can open a new issue to configure and fine-tune the client parameters. @y0psolo @msergg if you confirm this fix works as expected, let's get it merged and focus on the rate-limiting thing: feel free to open an issue. |
@bbusioc no need to open a new issue, this is open source and the support offered is based on a best-effort basis, and especially according to the maintainers availability. I tried to replicate your issue with the proposed changes, and it worked for me with no errors at all, although using
I tried to invert the groups:
The Tenant manifests are the following: apiVersion: v1
items:
- apiVersion: capsule.clastix.io/v1beta2
kind: Tenant
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"capsule.clastix.io/v1beta2","kind":"Tenant","metadata":{"annotations":{},"name":"solar"},"spec":{"owners":[{"kind":"Group","name":"group2"}]}}
creationTimestamp: "2023-09-29T13:37:03Z"
generation: 1
name: solar
resourceVersion: "265661"
uid: 95f1bf13-78b4-4042-8f5c-402a8fe0cb73
spec:
owners:
- clusterRoles:
- admin
- capsule-namespace-deleter
kind: Group
name: group2
status:
namespaces:
- solar-dev
size: 1
state: Active
- apiVersion: capsule.clastix.io/v1beta2
kind: Tenant
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"capsule.clastix.io/v1beta2","kind":"Tenant","metadata":{"annotations":{},"name":"wind"},"spec":{"owners":[{"kind":"Group","name":"group1"}]}}
creationTimestamp: "2023-09-29T13:37:50Z"
generation: 1
name: wind
resourceVersion: "265730"
uid: a92c659b-73a2-4c93-a224-e0143f435e4e
spec:
owners:
- clusterRoles:
- admin
- capsule-namespace-deleter
kind: Group
name: group1
status:
namespaces:
- wind-dev
size: 1
state: Active
kind: List
metadata:
resourceVersion: "" Furthermore, the proposed change is fetching multiple headers, so I think something is not working on your side, and I would keep the discussion addressing the specific issue. |
Closes #305.
@msergg may I ask you to give a try to these changes to your environment? Unfortunately, I don't have an Active Directory backed environment: you need to build on your own and push to a container registry.
https://github.com/clastix/capsule-proxy/blob/193bdab39373d0dfa470ae09956dbb38f25bb069/Makefile#L20-L22