Publish current project state

This commit is contained in:
2026-09-14 10:47:21 +08:00
parent 0dd188c46f
commit 4ad56ee9f8
186 changed files with 6289 additions and 1657 deletions
+14 -14
View File
@@ -19,17 +19,17 @@ import (
"github.com/gochat/gochat/internal/config"
"github.com/gochat/gochat/internal/middleware"
"github.com/gochat/gochat/internal/model"
"github.com/gochat/gochat/pkg/response"
applogger "github.com/gochat/gochat/pkg/logger"
"github.com/gochat/gochat/pkg/response"
)
// OIDCHandler handles OIDC/OAuth2 enterprise authentication HTTP endpoints.
type OIDCHandler struct {
oidcService *auth.OIDCService
ssoMiddleware *auth.SSOMiddleware
jwtService *auth.JWTService
refreshStore *auth.RefreshTokenStore
oidcCfg *config.OIDCConfig
oidcService *auth.OIDCService
ssoMiddleware *auth.SSOMiddleware
jwtService *auth.JWTService
refreshStore *auth.RefreshTokenStore
oidcCfg *config.OIDCConfig
}
// NewOIDCHandler creates an OIDC handler with service dependencies.
@@ -240,12 +240,12 @@ func (h *OIDCHandler) Callback(c *gin.Context) {
c.JSON(http.StatusOK, response.APIResponse{
Success: true,
Data: gin.H{
"access_token": accessToken,
"user_id": result.UserID,
"account_id": result.AccountID,
"role": result.Role,
"provider": string(result.Provider),
"session_id": sessionID,
"access_token": accessToken,
"user_id": result.UserID,
"account_id": result.AccountID,
"role": result.Role,
"provider": string(result.Provider),
"session_id": sessionID,
"auto_provisioned": result.AutoProvision,
},
})
@@ -531,10 +531,10 @@ func RegisterOIDCRoutes(rg *gin.RouterGroup, handler *OIDCHandler, authMiddlewar
// Admin-only config management routes (require auth + administrator role)
configGroup := oidcGroup.Group("/config")
configGroup.Use(authMiddleware, middleware.RoleCheck("administrator"))
configGroup.Use(authMiddleware, middleware.RoleCheck(auth.RoleAdministrator))
{
configGroup.GET("", handler.GetConfig)
configGroup.PUT("", handler.UpdateConfig)
}
}
}
}