-
Notifications
You must be signed in to change notification settings - Fork 121
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: access path for auth endpoints #1403
Conversation
Signed-off-by: veds-g <[email protected]>
Signed-off-by: veds-g <[email protected]>
Signed-off-by: veds-g <[email protected]>
Signed-off-by: veds-g <[email protected]>
Signed-off-by: veds-g <[email protected]>
server/authz/route_map.go
Outdated
// It is called only once when the server starts. | ||
// It adds baseHref to the routeMap keys. | ||
// For example, "GET:/api/v1/namespaces" becomes "GET:/baseHref/api/v1/namespaces". | ||
func InitializeRouteMapInfo(baseHref string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if there's a better pattern in the future.
server/authz/route_map.go
Outdated
"GET:/api/v1/metrics/namespaces/:namespace/pods": newRouteInfo(ObjectPipeline, true), | ||
"GET:/api/v1/namespaces/:namespace/pods/:pod/logs": newRouteInfo(ObjectPipeline, true), | ||
"GET:/api/v1/namespaces/:namespace/events": newRouteInfo(ObjectEvents, true), | ||
var AuthRouteMap routeMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global vars that are mutable could lead to race/concurrency issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, today we only update it once in the beginning, later we only perform read operations. Do you think this works as is now or should we refactor it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@veds-g - let's make routeMap
an argument to the Routes()
function, and pass to the casbin object.
Signed-off-by: veds-g <[email protected]>
auth/v1
api endpoints