mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-20 01:59:25 +00:00
Fix secret loading (#3620)
This commit is contained in:
@@ -169,12 +169,17 @@ func apiRoutes(e *gin.RouterGroup) {
|
||||
queue.GET("/norunningpipelines", api.BlockTilQueueHasRunningItem)
|
||||
}
|
||||
|
||||
// global secrets can be read without actual values by any user
|
||||
readGlobalSecrets := apiBase.Group("/secrets")
|
||||
{
|
||||
readGlobalSecrets.Use(session.MustUser())
|
||||
readGlobalSecrets.GET("", api.GetGlobalSecretList)
|
||||
readGlobalSecrets.GET("/:secret", api.GetGlobalSecret)
|
||||
}
|
||||
secrets := apiBase.Group("/secrets")
|
||||
{
|
||||
secrets.Use(session.MustAdmin())
|
||||
secrets.GET("", api.GetGlobalSecretList)
|
||||
secrets.POST("", api.PostGlobalSecret)
|
||||
secrets.GET("/:secret", api.GetGlobalSecret)
|
||||
secrets.PATCH("/:secret", api.PatchGlobalSecret)
|
||||
secrets.DELETE("/:secret", api.DeleteGlobalSecret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user