Commit Graph

404 Commits

Author SHA1 Message Date
maab fb6a5b89e5
Postgres tls/sslmode "verify-full" as default (#248)
* Make `verify-full` to default postgres sslmode instead of `disable`.

* Adding documentation about postgres sslmode changes to readme

* Change default of sslmode in postgres auth opt table

* Add sslmode to auth opts to fix tests.
2022-11-11 08:27:55 -03:00
Ignacio Gómez 821a58ec71
Merge pull request #251 from maab/fix-testcommands-in-readme
Fix docker commands in readme
2022-11-11 07:59:42 -03:00
Martin Abbrent 475a6cd5cd
Fix docker commands in readme: `run-test-in-docker.sh` requires bash but is called with sh. 2022-11-11 09:49:01 +01:00
Nick Ufer 92a9e105cc
feat: makes mutual TLS optional for postgres, mysql/mariadb and grpc (#244)
* feat: makes mutual TLS optional for postgres and mysql

* feat: makes mutual TLS optional for gRPC

* refactor: replaces deprecated grpc.WithInsecure()

* docs: changes meaning of grpc tls option to client cert

* chore: updates test go version to same as project version (1.18)

* test: adds TLS and mutual TLS support to db and grpc test environments

* chore: adds generated test certificates to .gitignore

* chore: reduces test certificates to minimum key usage

* chore: adds second client certificate which acts as unauthorized

* test: adds mysql tls and mutual tls tests

* refactor: postgres ssl config check

* refactor: change connectTries to 0 for postgres to only have 1 retry by default like mysql

* refactor: postgres sslmode and sslrootcert code

* test: adds postgres tls and mutual tls tests

* fix: treat grpc authOpts grpc_ca_cert, grpc_tls_cert, grpc_tls_key as file paths instead of actual file contents

refactor: improves error logging

* test: adds grpc tls and mutual tls tests

* Fix postgres ssl modes `require`, ``verify-ca` and `verify-full` to work without explicit root certificate.

* refactor: adds warning for unknown pg_sslmode

style: removes empty lines

* style: compress switch case

Co-authored-by: Martin Abbrent <martin.abbrent@ufz.de>
2022-10-05 16:32:36 -03:00
Ignacio Gómez a5ca115287
Merge pull request #243 from NickUfer/improve_headers_docs
docs: adds more details on how to obtain mosquitto headers
2022-09-05 14:19:30 -03:00
Nick Ufer 202c09a390
docs: adds more details on how to obtain mosquitto headers 2022-09-05 17:39:44 +02:00
Ignacio Gómez e351f00856
Merge pull request #241 from hardillb/bump-lws
Bump LWS version to 4.2.2
2022-08-17 11:31:17 -03:00
Ben Hardill 08cfd88ccc
Bump to latest mosquitto (2.0.15) 2022-08-16 18:01:04 +01:00
Ben Hardill 224d7d4d05
Bump LWS version
Also add LWS_WITH_EXTERNAL_POLL=ON  as this is required for
websockets to work properly

fixes #237
2022-08-16 10:23:59 +01:00
Ignacio Gómez e1c527a9c3
Merge pull request #234 from tetofonta/master
Dockerfile upgrade
2022-07-14 21:36:44 -04:00
Ignacio Gómez 9468bedaf2
Merge pull request #230 from ray66rus/ray66rus/issue-229-pass-decrypted-token-to-jwt-javascript-backend
Add option for sending decrypted claims to JWT Javascript backend
2022-06-15 23:42:45 -04:00
Pavel Tolstov 55321df94e Remove unused parameter from jwtRequest() 2022-06-15 11:28:28 +03:00
Stefano Fontana 390922f98a
fixed dockerfile style 2022-06-13 15:23:39 +02:00
Stefano Fontana c1c0fdda86
updated dockerfile removing comments as stated in https://github.com/iegomez/mosquitto-go-auth/pull/234#discussion_r895237341 2022-06-13 11:41:17 +02:00
Pavel Tolstov 4e1c35b4c9 Add posibility to get hostname of authorizing backend from "iss" claim of JWT token 2022-06-12 12:28:15 +03:00
Pavel Tolstov 788ee917e4 Add option for sending decrypted claims to JWT Javascript backend 2022-06-11 15:03:37 +03:00
Ignacio Gómez d904546ac6
Merge pull request #233 from iegomez/feat/http-method-option
HTTP/JWT request method
2022-06-10 18:20:35 -04:00
Stefano Fontana b125a11994
Dockerfile upgrade. Removed dupluicate code, final image has mosquitto_* 2022-06-08 21:12:24 +02:00
Ignacio Gómez 065ec97ee3
Use predefined http constants. Add tests to http backend. 2022-06-05 18:39:10 -04:00
Franz Auernigg 963a5ccb85
Add http method option. 2022-06-05 18:19:59 -04:00
Ignacio Gómez e051c0b345
Merge pull request #232 from iegomez/cleanup/update-go-and-dependencies
Update go and dependencies.
2022-06-05 18:00:29 -04:00
Ignacio Gómez 05b64b5567
Update go and dependencies. Adjust Redis interface. 2022-06-05 16:33:27 -04:00
Ignacio Gómez 98d8b4a6aa
Postgresql fix (#224)
* Add option to set DB connection max life time in seconds and document it.

Co-authored-by: Thomas Tvedt <thomas@gulost.net>
2022-04-04 19:31:59 -04:00
Ignacio Gómez 6975f3a176
Merge pull request #217 from thomastvedt/patch-1
Bump mosquitto version 2.0.14
2021-11-25 10:59:47 -03:00
Thomas Seljen Tvedt 9ded182766
Bump mosquitto version 2021-11-25 14:15:57 +01:00
Ignacio Gómez d8c1dca334
Merge pull request #206 from thomastvedt/thomastvedt/bump-mosquitto-version
Bump mosquitto version to 2.0.12
2021-10-06 09:21:22 -03:00
Thomas Tvedt f3c7cbcf0c Bump mosquitto version to 2.0.12 2021-10-06 12:26:45 +02:00
Ignacio Gómez 50f3512492
Merge pull request #202 from iegomez/issue-198-fix-firefox-websockets
Issue 198 fix firefox websockets
2021-09-28 09:20:18 -03:00
Ignacio Gómez 12ae7c9307
Merge pull request #201 from flumpt/issue-198-fix-firefox-websockets
Always building libwebsockets. Setting flags when running make for mo…
2021-09-28 08:20:14 -03:00
Fabian Gehrs 2331cb4709 Always building libwebsockets. Setting flags when running make for mosquitto. 2021-09-27 12:01:40 +02:00
Ignacio Gómez 3ec27456a1 Tidy go modules. 2021-09-23 21:58:54 -03:00
Ignacio Gómez d5cf2921e7
Merge pull request #200 from iegomez/issue-197-add-option-to-strip-prefixes
Add option to strip prefixes upon checking user or acl.
2021-09-23 21:49:05 -03:00
Ignacio Gómez 49073c8a62
Merge pull request #199 from iegomez/issue-198-fix-firefox-websockets
Disable http2 to workaround websockets issues in Firefox.
2021-09-23 20:42:26 -03:00
Ignacio Gómez fa99ba6583 Add option to strip prefixes upon checking user or acl. 2021-09-23 20:40:32 -03:00
Ignacio Gómez 842718728d Disable http2 to workaround websockets issues in Firefox. 2021-09-23 19:45:40 -03:00
Ignacio Gómez 1207622cb2
Merge pull request #196 from iegomez/feat/add-codeql-action
Codeql setup.
2021-09-15 16:47:05 -03:00
Ignacio Gómez a331aa1d73 Codeql setup.
Cleanup comments.
2021-09-15 16:12:00 -03:00
Ignacio Gómez b25ac28619
Merge pull request #195 from iegomez/security/patch-and-migrate-dependabot-alerts
Bump mongo driver version and migrate jwt module.
2021-09-15 15:47:36 -03:00
Ignacio Gómez 91e77551a7 Bump mongo driver version and migrate jwt module. 2021-09-15 15:16:49 -03:00
Ignacio Gómez 290c1c516a
Add gRPC options to set timeout and skip dial errors (#193)
* Don't bubble up grpc client error, just keep it nil and derive it again on checking.

Add option to check if we should faild on gRCP dial error or not.

Add timeout option.

* Instead of attempting on each check, remove with block when fail on dial error is not set to true so gRPC takes care of the connection itself.
Add tests to check that auth fails with dial errors, but works once the service is back up.

* Fix docker files missing libwebsockets8 by building from source, fix docker test run by starting maridb service instead of mysql one.

Co-authored-by: Ignacio Gómez <ignacio_gomez@apple.com>
2021-09-15 13:46:44 -03:00
Paul Traylor 5dc063f104
Add user-agent to requests (#176)
* Add default 'mosquitto' user-agent to http/jwt requests

* Add libmosquitto version ofr http and jwt remote user agent.

Add more room for extended versions.

Co-authored-by: Ignacio Gómez <iegomez@uc.cl>
2021-07-11 21:52:22 -04:00
arctic-alpaca cff71ffe69
Add GitHub actions workflow to automaticall build and push Docker images (#179)
* Add support for Mosquitto version >=2.x and arm

* Hopefully fix ARMv6 build

* Add disclaimer regarding tests on hardware

* Add github actions workflow to build Docker images
2021-06-25 18:42:32 -04:00
arctic-alpaca 1c8e24b650
Add support for Mosquitto version >=2.x and arm(v7 and 64) to Dockerfile (#163)
* Add support for Mosquitto version >=2.x and arm

* Hopefully fix ARMv6 build

* Add disclaimer regarding tests on hardware
2021-06-10 09:53:09 -04:00
Paul Traylor d895cf567a
Add 'tini' as init to handle signals more correctly (#178) 2021-06-03 19:00:31 -04:00
Alberto Geniola 2d264437df
Updated README (#177)
Bump versions, state minimum Go version and add example instructions.
2021-05-31 21:33:45 -04:00
Joachim Danmayr 45b8a85f02
Added monogdb TLS option (#170)
* Added monogdb TLS option

* Syntax fix

* Made TLS configurable

* Update README.md

Chnaged tls option name

Co-authored-by: Ignacio Gómez <iegomez@uc.cl>

* Update README.md

Chnaged tls option name.

Co-authored-by: Ignacio Gómez <iegomez@uc.cl>

* Update backends/mongo.go

Chnaged tls option name

Co-authored-by: Ignacio Gómez <iegomez@uc.cl>

* Update backends/mongo.go

Better style for setting TLS option

Co-authored-by: Ignacio Gómez <iegomez@uc.cl>

* Better style for setting TLS config

* Fixed variable name in struct

* Chnaged tab in Readme

* Added option to dkip TLS verify

Co-authored-by: Joachim Danmayr <danmayr.joachim@fronius.com>
Co-authored-by: Ignacio Gómez <iegomez@uc.cl>
2021-04-30 09:43:31 -04:00
Ignacio Gómez f28476090b
Merge pull request #166 from iegomez/feat/jwt-files
[JWT]: Add files-like ACLs
2021-04-27 19:59:27 -04:00
Ignacio Gómez ee6e68db3a
Add JWT files mode. Now both JWT and Files may use the generally available strict files checker.
Files should be able to check ACLs only.
Clen setPrefixes method.
Fix test-backends by building custom plugin too, fix files only acls by checking if a user was seen before creating a general record.
2021-04-27 19:58:54 -04:00
Ignacio Gómez 3eea16872d
Merge pull request #159 from iegomez/feat/register-backend-functions
[Backens] Register checks
2021-03-11 20:17:31 -03:00
Ignacio Gómez 16db4e244f
With a prefixed user, skip superuser check when disabled or not registered. 2021-03-10 22:57:52 -03:00