Skip to content

Commit

Permalink
feat(release): Add basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton committed Oct 3, 2018
1 parent 3b04c06 commit 677bc66
Show file tree
Hide file tree
Showing 385 changed files with 198,118 additions and 1 deletion.
73 changes: 72 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ package server
import (
"github.com/berty/staff/tools/release/pkg/circle"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)

const USER = "berty"
const SECRET = "hu2go5ru"

type httperror struct {
message string `json:message`
}
Expand All @@ -15,6 +19,11 @@ type Server struct {
e *echo.Echo
}

// Basic auth
func basicAuth(username, password string, c echo.Context) (bool, error) {
return username == USER && password == SECRET, nil
}

func NewServer(client *circle.Client, hostname string) *Server {
e := echo.New()
s := &Server{client, hostname, e}
Expand All @@ -25,6 +34,8 @@ func NewServer(client *circle.Client, hostname string) *Server {
e.GET("/release/ios/*", s.ReleaseIOS)
e.GET("/artifacts/:build_id", s.Artifacts)

e.Use(middleware.BasicAuth(basicAuth))

return s
}

Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/dgrijalva/jwt-go/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions vendor/github.com/dgrijalva/jwt-go/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/dgrijalva/jwt-go/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 97 additions & 0 deletions vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 100 additions & 0 deletions vendor/github.com/dgrijalva/jwt-go/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 677bc66

Please sign in to comment.