Skip to content

Fix Go build errors in quota and auth modules#39

Merged
JoshuaAFerguson merged 1 commit into
mainfrom
claude/fix-build-errors-019Fu9K921RdjWca6dHa8e2a
Nov 16, 2025
Merged

Fix Go build errors in quota and auth modules#39
JoshuaAFerguson merged 1 commit into
mainfrom
claude/fix-build-errors-019Fu9K921RdjWca6dHa8e2a

Conversation

@JoshuaAFerguson

Copy link
Copy Markdown
Member

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.

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.
@JoshuaAFerguson JoshuaAFerguson merged commit 82eb824 into main Nov 16, 2025
8 of 23 checks passed
@JoshuaAFerguson JoshuaAFerguson deleted the claude/fix-build-errors-019Fu9K921RdjWca6dHa8e2a branch November 16, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants