Skip to content

Commit

Permalink
Merge pull request #18 from gewv-tu-dresden/go_dependencies
Browse files Browse the repository at this point in the history
update  go dependencies
  • Loading branch information
Malte96 authored Nov 11, 2024
2 parents 5f4965c + 9cbb633 commit cc42e87
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Set mosquitto, golang and libwebsocket versions.
#Change them as per your needs.
ARG MOSQUITTO_VERSION=2.0.18
ARG MOSQUITTO_VERSION=2.0.20
ARG GOLANG_VERSION=1.22.4
ARG LWS_VERSION=4.2.2
ARG LWS_VERSION=4.3.3

#Use debian:stable-slim as a builder and then copy everything.
FROM debian:stable-slim as builder
FROM debian:stable-slim AS builder

ARG MOSQUITTO_VERSION
ARG LWS_VERSION
Expand Down Expand Up @@ -70,6 +70,9 @@ COPY --from=builder /usr/local/include/ /usr/local/include/

COPY ./mosquitto-go-auth /app

# Replace the Go module file and the checksum file
COPY go_files /app

#Build the basic auth plugin.
RUN set -ex; \
go build -buildmode=c-archive go-auth.go; \
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ Configuration options are listed below:
| `oauth_cache_duration` | Cache duration (in seconds) before the plugin request user info from Oauth2 server. `0` by default. | N |
| `oauth_scopes` | Comma separated list of requested scopes. No scope by default. | N |

## How to test
## How to use

The simplest way is to use the delivered dockerfile and build your own image. You can use volumes to import the configurations or copy the files in the images while you build it.
If you use volumes you have to remove the `COPY` commands from the Dockerfile.
- If you use volumes you have to remove the `COPY` commands from the Dockerfile.
- Due to problems with the golang versions of [mosquitto-go-auth](./mosquitto-go-auth), the environment will be updated with the new golang files in [go_files](go_files).

You can use the attached [docker-compose.yml](docker-compose.yml) for deployment.

You can use the attached [docker-compose.yml](docker-compose.yml) for deployment.
Images are also available on dockerhub: [gewvtudresden/mosquitto-go-auth-oauth2](https://hub.docker.com/r/gewvtudresden/mosquitto-go-auth-oauth2)
52 changes: 52 additions & 0 deletions go_files/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module github.com/iegomez/mosquitto-go-auth

go 1.22

toolchain go1.22.4

require (
github.com/go-redis/redis/v8 v8.11.5
github.com/go-sql-driver/mysql v1.8.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.22
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/robertkrimen/otto v0.4.0
github.com/sirupsen/logrus v1.9.3
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
github.com/stretchr/testify v1.8.1
go.mongodb.org/mongo-driver v1.15.1
golang.org/x/crypto v0.24.0
google.golang.org/grpc v1.64.0
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190328170749-bb2674552d8f // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240424034433-3c2c7870ae76 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit cc42e87

Please sign in to comment.