mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-01 21:28:44 +00:00
Integrated team secrets dummy API
This commit is contained in:
parent
1b84375db5
commit
9aac9e5bf7
2 changed files with 31 additions and 0 deletions
|
@ -62,6 +62,18 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
|
||||||
users.DELETE("/:login", server.DeleteUser)
|
users.DELETE("/:login", server.DeleteUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
teams := e.Group("/api/teams")
|
||||||
|
{
|
||||||
|
// TODO: Restrict access
|
||||||
|
|
||||||
|
team := teams.Group("/:team")
|
||||||
|
{
|
||||||
|
team.GET("/secrets", server.GetTeamSecrets)
|
||||||
|
team.POST("/secrets", server.PostTeamSecret)
|
||||||
|
team.DELETE("/secrets/:secret", server.DeleteTeamSecret)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repos := e.Group("/api/repos/:owner/:name")
|
repos := e.Group("/api/repos/:owner/:name")
|
||||||
{
|
{
|
||||||
repos.POST("", server.PostRepo)
|
repos.POST("", server.PostRepo)
|
||||||
|
|
|
@ -28,6 +28,15 @@ func GetSecrets(c *gin.Context) {
|
||||||
c.JSON(http.StatusOK, list)
|
c.JSON(http.StatusOK, list)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetTeamSecrets(c *gin.Context) {
|
||||||
|
var (
|
||||||
|
list []*model.Secret
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO(must): Integrate a real implementation
|
||||||
|
c.JSON(http.StatusOK, list)
|
||||||
|
}
|
||||||
|
|
||||||
func PostSecret(c *gin.Context) {
|
func PostSecret(c *gin.Context) {
|
||||||
repo := session.Repo(c)
|
repo := session.Repo(c)
|
||||||
|
|
||||||
|
@ -49,6 +58,11 @@ func PostSecret(c *gin.Context) {
|
||||||
c.String(http.StatusOK, "")
|
c.String(http.StatusOK, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PostTeamSecret(c *gin.Context) {
|
||||||
|
c.String(http.StatusOK, "")
|
||||||
|
// TODO(must): Integrate a real implementation
|
||||||
|
}
|
||||||
|
|
||||||
func DeleteSecret(c *gin.Context) {
|
func DeleteSecret(c *gin.Context) {
|
||||||
repo := session.Repo(c)
|
repo := session.Repo(c)
|
||||||
name := c.Param("secret")
|
name := c.Param("secret")
|
||||||
|
@ -66,3 +80,8 @@ func DeleteSecret(c *gin.Context) {
|
||||||
|
|
||||||
c.String(http.StatusOK, "")
|
c.String(http.StatusOK, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DeleteTeamSecret(c *gin.Context) {
|
||||||
|
c.String(http.StatusOK, "")
|
||||||
|
// TODO(must): Integrate a real implementation
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue