diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1698e81 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [Unreleased] +There are currently no unreleased changes. + +## v0.0.0 - 2020-06-01 +This is the first version that includes the following functionality: +- YAML configuration support + - Route matching with standard wildcards + - Array and value claim checks +- HMAC, RSA and EC signing key support for JWT authentication +- Claims-based authorization +- Pure authorization server and reverse proxy modes + +[Unreleased]: https://github.com/kaancfidan/bouncer/compare/v0.0.0...master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bd55f4e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.13 AS builder +ARG VERSION +WORKDIR /go/src/github.com/kaancfidan/bouncer +COPY . . +RUN go get -d -v +RUN sed -i "s/0.0.0-VERSION/"$VERSION"/" main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" + +FROM scratch +COPY --from=builder /go/src/github.com/kaancfidan/bouncer/bouncer bouncer +ENTRYPOINT ["./bouncer"] diff --git a/hooks/build b/hooks/build new file mode 100644 index 0000000..27428e9 --- /dev/null +++ b/hooks/build @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build -t $IMAGE_NAME --build-arg VERSION=`git describe --tags || git describe` . diff --git a/main.go b/main.go index 8c6fd3e..632f11b 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,8 @@ func parseFlags() *flags { expRequired: "true", nbfRequired: "true", } - + + printVersion := flag.Bool("v", false, "print version and exit") flag.StringVar(&f.signingKey, "k", lookupEnv("BOUNCER_SIGNING_KEY", ""), "cryptographic signing key") @@ -162,6 +163,11 @@ func parseFlags() *flags { flag.Parse() + if *printVersion { + fmt.Printf("Bouncer version: %s\n", version) + os.Exit(0) + } + return &f }