Fix Go build errors in quota and auth modules#39
Merged
JoshuaAFerguson merged 1 commit intoNov 16, 2025
Conversation
Fixed the following compilation errors in the API codebase: 1. **UserQuota model fields** (internal/quota/enforcer.go): - Fixed type mismatch between UserQuota/GroupQuota models (string fields) and Limits struct (int64 fields) - Added proper parsing of Kubernetes resource quantities (MaxCPU, MaxMemory, MaxStorage) - Updated GetUserLimits to parse string quota values from database models 2. **SAML authentication** (internal/auth/saml.go, handlers.go): - Added GetServiceProvider() method to SAMLAuthenticator for metadata endpoint - Added ExtractUserFromAttributes() method to work with samlsp.Attributes map - Fixed metadata XML serialization in handlers (added xml.Marshal) - Added missing imports: encoding/xml, fmt 3. **OIDC authentication** (internal/auth/oidc.go): - Added missing crypto/tls import for TLS configuration 4. **Middleware** (internal/auth/middleware.go): - Removed unused context import 5. **Compression middleware** (internal/middleware/compression.go): - Fixed function signature: changed *gin.Context.Request to *http.Request - Added missing net/http import 6. **Input validation middleware** (internal/middleware/inputvalidation.go): - Fixed variable shadowing in sanitizeMap and sanitizeArray methods - Changed switch variable from 'v' to 'val' to avoid shadowing receiver All application code errors are now resolved. Remaining k8s.io/apimachinery dependency issue is an upstream compatibility problem between structured-merge-diff v4 and v6 that may require updated dependencies or network connectivity during build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed the following compilation errors in the API codebase:
UserQuota model fields (internal/quota/enforcer.go):
SAML authentication (internal/auth/saml.go, handlers.go):
OIDC authentication (internal/auth/oidc.go):
Middleware (internal/auth/middleware.go):
Compression middleware (internal/middleware/compression.go):
Input validation middleware (internal/middleware/inputvalidation.go):
All application code errors are now resolved. Remaining k8s.io/apimachinery dependency issue is an upstream compatibility problem between structured-merge-diff v4 and v6 that may require updated dependencies or network connectivity during build.