Skip to content

Commit

Permalink
refactor: isPlugin for API level
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat-Dabade committed Jun 27, 2024
1 parent 0b6e443 commit 6191901
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 361 deletions.
11 changes: 4 additions & 7 deletions server/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type API struct {
MattermostAuth bool
logger mlog.LoggerIFace
audit *audit.Audit
isPlugin bool
}

func NewAPI(
Expand All @@ -51,7 +50,6 @@ func NewAPI(
permissions permissions.PermissionsService,
logger mlog.LoggerIFace,
audit *audit.Audit,
isPlugin bool,
) *API {
return &API{
app: app,
Expand All @@ -60,7 +58,6 @@ func NewAPI(
permissions: permissions,
logger: logger,
audit: audit,
isPlugin: isPlugin,
}
}

Expand All @@ -77,7 +74,7 @@ func (a *API) RegisterRoutes(r *mux.Router) {

// V2 routes (ToDo: migrate these to V3 when ready to ship V3)
a.registerUsersRoutes(apiv2)
a.registerAuthRoutes(apiv2)
// a.registerAuthRoutes(apiv2)
a.registerMembersRoutes(apiv2)
a.registerCategoriesRoutes(apiv2)
a.registerSharingRoutes(apiv2)
Expand All @@ -104,9 +101,9 @@ func (a *API) RegisterRoutes(r *mux.Router) {
a.registerSystemRoutes(r)
}

func (a *API) RegisterAdminRoutes(r *mux.Router) {
r.HandleFunc("/api/v2/admin/users/{username}/password", a.adminRequired(a.handleAdminSetPassword)).Methods("POST")
}
// func (a *API) RegisterAdminRoutes(r *mux.Router) {
// r.HandleFunc("/api/v2/admin/users/{username}/password", a.adminRequired(a.handleAdminSetPassword)).Methods("POST")
// }

func getUserID(r *http.Request) string {
ctx := r.Context()
Expand Down
Loading

0 comments on commit 6191901

Please sign in to comment.