1
0

feat(api tokens): add crud routes to manage api tokens

This commit is contained in:
kolaente
2023-08-31 20:37:25 +02:00
parent 3faf48706a
commit e6b25bd57b
5 changed files with 154 additions and 9 deletions

View File

@ -563,6 +563,16 @@ func registerAPIRoutes(a *echo.Group) {
a.GET("/backgrounds/unsplash/images/:image", unsplash.ProxyUnsplashImage)
}
}
// API Tokens
apiTokenProvider := &handler.WebHandler{
EmptyStruct: func() handler.CObject {
return &models.APIToken{}
},
}
a.GET("/tokens", apiTokenProvider.ReadAllWeb)
a.PUT("/tokens", apiTokenProvider.CreateWeb)
a.DELETE("/tokens/:token", apiTokenProvider.DeleteWeb)
}
func registerMigrations(m *echo.Group) {