Explorar el Código

chore(go): cleanup;

Vishal Dalwadi hace 3 meses
padre
commit
d239d04f2f
Se han modificado 5 ficheros con 6 adiciones y 8 borrados
  1. 0 1
      config/config.go
  2. 0 2
      database/database.go
  3. 5 0
      pro/controllers/users.go
  4. 1 3
      pro/initialize.go
  5. 0 2
      scripts/netmaker.default.env

+ 0 - 1
config/config.go

@@ -63,7 +63,6 @@ type ServerConfig struct {
 	FrontendURL                string        `yaml:"frontendurl"`
 	DisplayKeys                string        `yaml:"displaykeys"`
 	AzureTenant                string        `yaml:"azuretenant"`
-	IDPSyncInterval            string        `yaml:"idp_sync_interval"`
 	Telemetry                  string        `yaml:"telemetry"`
 	HostNetwork                string        `yaml:"hostnetwork"`
 	Server                     string        `yaml:"server"`

+ 0 - 2
database/database.go

@@ -19,8 +19,6 @@ const (
 	DELETED_NODES_TABLE_NAME = "deletednodes"
 	// USERS_TABLE_NAME - users table
 	USERS_TABLE_NAME = "users"
-	// ACCESS_TOKENS_TABLE_NAME - access tokens table
-	ACCESS_TOKENS_TABLE_NAME = "user_access_tokens"
 	// USER_PERMISSIONS_TABLE_NAME - user permissions table
 	USER_PERMISSIONS_TABLE_NAME = "user_permissions"
 	// CERTS_TABLE_NAME - certificates table

+ 5 - 0
pro/controllers/users.go

@@ -1422,6 +1422,11 @@ func syncIDP(w http.ResponseWriter, r *http.Request) {
 	logic.ReturnSuccessResponse(w, r, "starting sync from idp")
 }
 
+// @Summary     Remove idp integration.
+// @Router      /api/idp [delete]
+// @Tags        IDP
+// @Success     200 {object} models.SuccessResponse
+// @Failure     500 {object} models.ErrorResponse
 func removeIDPIntegration(w http.ResponseWriter, r *http.Request) {
 	superAdmin, err := logic.GetSuperAdmin()
 	if err != nil {

+ 1 - 3
pro/initialize.go

@@ -90,11 +90,9 @@ func InitPro() {
 		} else {
 			slog.Error("no OAuth provider found or not configured, continuing without OAuth")
 		}
-
-		go auth.StartSyncHook()
-
 		proLogic.LoadNodeMetricsToCache()
 		proLogic.InitFailOverCache()
+		auth.StartSyncHook()
 		email.Init()
 	})
 	logic.ResetFailOver = proLogic.ResetFailOver

+ 0 - 2
scripts/netmaker.default.env

@@ -102,5 +102,3 @@ STUN=true
 METRICS_PORT=51821
 # Metrics Collection interval in minutes
 PUBLISH_METRIC_INTERVAL=15
-# IDP Sync Interval with units.
-IDP_SYNC_INTERVAL=24h