mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-25 18:00:25 +08:00
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:
@@ -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(), "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user