Integrated team secrets dummy API

This commit is contained in:
Thomas Boerger 2016-07-25 17:20:14 +02:00 committed by Thomas Boerger
parent 1b84375db5
commit 9aac9e5bf7
No known key found for this signature in database
GPG key ID: 5A388F55283960B6
2 changed files with 31 additions and 0 deletions

View file

@ -62,6 +62,18 @@ func Load(middleware ...gin.HandlerFunc) http.Handler {
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.POST("", server.PostRepo)

View file

@ -28,6 +28,15 @@ func GetSecrets(c *gin.Context) {
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) {
repo := session.Repo(c)
@ -49,6 +58,11 @@ func PostSecret(c *gin.Context) {
c.String(http.StatusOK, "")
}
func PostTeamSecret(c *gin.Context) {
c.String(http.StatusOK, "")
// TODO(must): Integrate a real implementation
}
func DeleteSecret(c *gin.Context) {
repo := session.Repo(c)
name := c.Param("secret")
@ -66,3 +80,8 @@ func DeleteSecret(c *gin.Context) {
c.String(http.StatusOK, "")
}
func DeleteTeamSecret(c *gin.Context) {
c.String(http.StatusOK, "")
// TODO(must): Integrate a real implementation
}