Skip to content

Commit

Permalink
chore(name): rename jwt-block to jwtblock (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
SafeEval authored Jul 24, 2024
1 parent cc6ac0c commit 4ab11a5
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Update pkg.go.dev records
if: github.ref_type == 'tag'
run: go list -m "github.com/divergentcodes/jwt-block@${{ github.ref_name }}"
run: go list -m "github.com/divergentcodes/jwtblock@${{ github.ref_name }}"
env:
GOPROXY: proxy.golang.org

10 changes: 5 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GoReleaser configuration.
# Documentation: https://goreleaser.com

project_name: jwt-block
project_name: jwtblock

before:
hooks:
Expand All @@ -24,10 +24,10 @@ builds:
# -w disable DWARF generation
- '-w'
# -X set module variables at build time
- '-X github.com/divergentcodes/jwt-block/internal/core.Version={{.Version}}'
- '-X github.com/divergentcodes/jwt-block/internal/core.Commit={{.Commit}}'
- '-X github.com/divergentcodes/jwt-block/internal/core.Date={{.Date}}'
- '-X github.com/divergentcodes/jwt-block/internal/core.BuiltBy=goreleaser'
- '-X github.com/divergentcodes/jwtblock/internal/core.Version={{.Version}}'
- '-X github.com/divergentcodes/jwtblock/internal/core.Commit={{.Commit}}'
- '-X github.com/divergentcodes/jwtblock/internal/core.Date={{.Date}}'
- '-X github.com/divergentcodes/jwtblock/internal/core.BuiltBy=goreleaser'

dockers:
-
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:alpine AS builder
# Where to find the local built jwt-block binary.
# Where to find the local built jwtblock binary.
ARG SRC_BIN_DIR="."
# Create an unprivileged user.
RUN adduser --system --no-create-home app
# Create an unprivileged runtime location with the binary.
RUN mkdir /app
# Copy the Golang binary.
COPY ${SRC_BIN_DIR}/jwt-block /app/jwt-block
COPY ${SRC_BIN_DIR}/jwtblock /app/jwtblock
RUN chown -R app /app


Expand All @@ -17,5 +17,5 @@ COPY --from=builder /app /app
# Run as the unprivileged user.
USER app

ENTRYPOINT ["/app/jwt-block"]
ENTRYPOINT ["/app/jwtblock"]
CMD ["serve"]
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JWT Block

[![Go Reference](https://pkg.go.dev/badge/github.com/divergentcodes/jwt-block.svg)](https://pkg.go.dev/github.com/divergentcodes/jwt-block)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DivergentCodes/jwt-block/release.yaml?style=flat-square)](https://github.com/DivergentCodes/jwt-block/actions?query=workflow%3Arelease)
[![Go Reference](https://pkg.go.dev/badge/github.com/divergentcodes/jwtblock.svg)](https://pkg.go.dev/github.com/divergentcodes/jwtblock)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/DivergentCodes/jwtblock/release.yaml?style=flat-square)](https://github.com/DivergentCodes/jwtblock/actions?query=workflow%3Arelease)

Exploring the feasability and performance of a JWT blocklist.

Expand All @@ -13,13 +13,13 @@ It is a standalone binary that requires a Redis instance to store the blocklist.

## Installation

Download the [binary release](https://github.com/DivergentCodes/jwt-block/releases) for your platform,
Download the [binary release](https://github.com/DivergentCodes/jwtblock/releases) for your platform,
and place it in the executable path.

JWT Block is also available as [a Docker image](https://hub.docker.com/r/divergentcodes/jwt-block).
JWT Block is also available as [a Docker image](https://hub.docker.com/r/divergentcodes/jwtblock).

```
docker run -it --rm divergentcodes/jwt-block:latest
docker run -it --rm divergentcodes/jwtblock:latest
```


Expand All @@ -29,7 +29,7 @@ docker run -it --rm divergentcodes/jwt-block:latest
JWT Block is a blocklist & auth proxy service for JWTs, to support immediate termination of access, since access tokens cannot truly be revoked.
Usage:
jwt-block [command]
jwtblock [command]
Available Commands:
block Block a JWT
Expand All @@ -41,12 +41,12 @@ Available Commands:
serve Serve the web API
status Get status of the blocklist
unblock Unblock a JWT
version Print the version of jwt-block
version Print the version of jwtblock
Flags:
--config string config file (default is ./jwt-block.yaml)
--config string config file (default is ./jwtblock.yaml)
--debug Enable debug mode
-h, --help help for jwt-block
-h, --help help for jwtblock
--json Use JSON output
-q, --quiet Quiet CLI output
--redis-dbnum int Redis DB number
Expand All @@ -58,7 +58,7 @@ Flags:
--redis-user string Redis username
--verbose Verbose CLI output
Use "jwt-block [command] --help" for more information about a command.
Use "jwtblock [command] --help" for more information about a command.
```

## Configuration
Expand Down
10 changes: 5 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ git tag "v1.0.2-alpha03"; git push --tags
The `release` Github Actions workflow will be triggered, running GoReleaser.
A new binary will be built, a Docker image and documentation with be pushed.

Pull the latest image: `docker pull divergentcodes/jwt-block:latest`
Pull the latest image: `docker pull divergentcodes/jwtblock:latest`

View the latest Docker release: https://hub.docker.com/r/divergentcodes/jwt-block
View the latest Docker release: https://hub.docker.com/r/divergentcodes/jwtblock


## Changelog Updates
Expand All @@ -32,10 +32,10 @@ To be included in a changelog, PR titles must be one of these prefixes:

## Links

- Binary downloads: https://github.com/DivergentCodes/jwt-block/releases
- Binary downloads: https://github.com/DivergentCodes/jwtblock/releases

- Docker images: https://hub.docker.com/r/divergentcodes/jwt-block
- Docker images: https://hub.docker.com/r/divergentcodes/jwtblock

- JWT Block docs: https://pkg.go.dev/github.com/divergentcodes/jwt-block
- JWT Block docs: https://pkg.go.dev/github.com/divergentcodes/jwtblock


6 changes: 3 additions & 3 deletions cmd/jwt-block/block.go → cmd/jwtblock/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/jwt-block/check.go → cmd/jwtblock/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/jwt-block/flush.go → cmd/jwtblock/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var flushCmd = &cobra.Command{
Expand Down
6 changes: 3 additions & 3 deletions cmd/jwt-block/list.go → cmd/jwtblock/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var listCmd = &cobra.Command{
Expand Down
8 changes: 4 additions & 4 deletions cmd/jwt-block/openapi.go → cmd/jwtblock/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwt-block/web"
"github.com/divergentcodes/jwtblock/internal/core"
"github.com/divergentcodes/jwtblock/web"
)

var openapiCmd = &cobra.Command{
Use: "openapi",
Short: "Generate OpenAPI specs for jwt-block",
Long: "Generate OpenAPI specs for jwt-block",
Short: "Generate OpenAPI specs for jwtblock",
Long: "Generate OpenAPI specs for jwtblock",
Run: openapi,
}

Expand Down
14 changes: 7 additions & 7 deletions cmd/jwt-block/root.go → cmd/jwtblock/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ JWT Block is a blocklist & auth proxy service for JWTs, to support immediate ter
Usage:
jwt-block [command]
jwtblock [command]
Available Commands:
Expand All @@ -16,13 +16,13 @@ Available Commands:
serve Serve the web API
status Get status of the blocklist
unblock Unblock a JWT
version Print the version of jwt-block
version Print the version of jwtblock
Flags:
--config string config file (default is ./jwt-block.yaml)
--config string config file (default is ./jwtblock.yaml)
--debug Enable debug mode
-h, --help help for jwt-block
-h, --help help for jwtblock
--json Use JSON output
-q, --quiet Quiet CLI output
--redis-dbnum int Redis DB number
Expand All @@ -42,12 +42,12 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/core"
)

var (
rootCmd = &cobra.Command{
Use: "jwt-block",
Use: "jwtblock",
Short: "A JWT blocklist & auth proxy service",
Long: `JWT Block is a blocklist & auth proxy service for JWTs, to support immediate termination of access, since access tokens cannot truly be revoked.`,
}
Expand All @@ -64,7 +64,7 @@ func initRootFlags() {

// config
var cfgFile string
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./jwt-block.yaml)")
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./jwtblock.yaml)")
if cfgFile != "" {
// Use config file from the flag.
viper.SetConfigFile(cfgFile)
Expand Down
8 changes: 4 additions & 4 deletions cmd/jwt-block/serve.go → cmd/jwtblock/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwt-block/web"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
"github.com/divergentcodes/jwtblock/web"
)

var (
Expand Down Expand Up @@ -82,6 +82,6 @@ func serve(cmd *cobra.Command, args []string) {

host := viper.GetString(core.OptStr_HttpHostname)
port := viper.GetInt(core.OptStr_HttpPort)
fmt.Printf("Serving the jwt-block web API on %s:%d\n", host, port)
fmt.Printf("Serving the jwtblock web API on %s:%d\n", host, port)
web.HandleRequests(host, port)
}
6 changes: 3 additions & 3 deletions cmd/jwt-block/status.go → cmd/jwtblock/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var statusCmd = &cobra.Command{
Expand Down
6 changes: 3 additions & 3 deletions cmd/jwt-block/unblock.go → cmd/jwtblock/unblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/blocklist"
"github.com/divergentcodes/jwt-block/internal/cache"
"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/blocklist"
"github.com/divergentcodes/jwtblock/internal/cache"
"github.com/divergentcodes/jwtblock/internal/core"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/jwt-block/version.go → cmd/jwtblock/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (

"github.com/spf13/cobra"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/core"
)

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version of jwt-block",
Long: `Print the version of jwt-block`,
Short: "Print the version of jwtblock",
Long: `Print the version of jwtblock`,
Run: version,
}

Expand Down
4 changes: 2 additions & 2 deletions examples/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ services:

# The JWT Block auth service.
jwtblock:
image: "divergentcodes/jwt-block:local"
image: "divergentcodes/jwtblock:local"
build:
context: "./../../"
dockerfile: "Dockerfile"
args:
- SRC_BIN_DIR=./dist/jwt-block_linux_amd64_v1
- SRC_BIN_DIR=./dist/jwtblock_linux_amd64_v1
environment:
- JWTBLOCK_DEBUG=1
- JWTBLOCK_REDIS_HOST=cache
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/divergentcodes/jwt-block
module github.com/divergentcodes/jwtblock

go 1.20

Expand Down
4 changes: 2 additions & 2 deletions internal/blocklist/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/redis/go-redis/v9"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwt-block/internal/crypto"
"github.com/divergentcodes/jwtblock/internal/core"
"github.com/divergentcodes/jwtblock/internal/crypto"
)

// A BlockResult contains the result of trying to block a token.
Expand Down
4 changes: 2 additions & 2 deletions internal/blocklist/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/lestrrat-go/jwx/v2/jwt"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwt-block/internal/crypto"
"github.com/divergentcodes/jwtblock/internal/core"
"github.com/divergentcodes/jwtblock/internal/crypto"
)

var rsaPublicKey string = `-----BEGIN PUBLIC KEY-----
Expand Down
2 changes: 1 addition & 1 deletion internal/blocklist/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package blocklist
import (
"github.com/redis/go-redis/v9"

"github.com/divergentcodes/jwt-block/internal/crypto"
"github.com/divergentcodes/jwtblock/internal/crypto"
)

// A CheckResult contains the result of checking for a token in the blocklist.
Expand Down
4 changes: 2 additions & 2 deletions internal/blocklist/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/go-redis/redismock/v9"
"github.com/spf13/viper"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwt-block/internal/crypto"
"github.com/divergentcodes/jwtblock/internal/core"
"github.com/divergentcodes/jwtblock/internal/crypto"
)

func Test_CheckByJwt_ValidToken_ExistsFound_Success(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/blocklist/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package blocklist
import (
"github.com/redis/go-redis/v9"

"github.com/divergentcodes/jwt-block/internal/core"
"github.com/divergentcodes/jwtblock/internal/core"
)

// A FlushResult contains the result of checking for a token in the blocklist.
Expand Down
Loading

0 comments on commit 4ab11a5

Please sign in to comment.