NET-2077: Add support for Feature Flags. (#3528)

* feat(go): add support for feature flags;

* feat(go): store feature flags in code;

* feat(go): report base domain on license validation;

* feat(go): remove nm base domain required binding;

* feat(go): add a flag for oauth support;
This commit is contained in:
Vishal Dalwadi
2025-07-27 08:39:17 +05:30
committed by GitHub
parent 461c680099
commit 6367efc882
7 changed files with 44 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ func serverHandlers(r *mux.Router) {
Methods(http.MethodPost)
r.HandleFunc("/api/server/mem_profile", logic.SecurityCheck(false, http.HandlerFunc(memProfile))).
Methods(http.MethodPost)
r.HandleFunc("/api/server/feature_flags", getFeatureFlags).Methods(http.MethodGet)
}
func cpuProfile(w http.ResponseWriter, r *http.Request) {
@@ -325,3 +326,12 @@ func reInit(curr, new models.ServerSettings, force bool) {
go mq.PublishPeerUpdate(false)
}
// @Summary Get feature flags for this server.
// @Router /api/server/feature_flags [get]
// @Tags Server
// @Security oauth2
// @Success 200 {object} config.ServerSettings
func getFeatureFlags(w http.ResponseWriter, r *http.Request) {
logic.ReturnSuccessResponseWithJson(w, r, logic.GetFeatureFlags(), "")
}