syncthing/lib/relay/client
entity0xfe ad986f372d
cmd/strelaysrv: Add optional auth token (fixes #3987) (#8561)
* implement authentication via token for relaysrv

Make replaysrv check for a token before allowing clients to
join. The token can be set via the replay-uri.

* fix formatting

* key composite literal

* do not error out if auth material is provided but not needed

* remove unused method receiver

* clean up unused parameter in functions

* cleaner token handling, disable joining the pool if token is set.

* Keep backwards compatibility with older clients.

In prior versions of the protocol JoinRelayRequest did not have a
token field. Trying to unmarshal such a request will result in
an error. Return an empty JoinRelayRequest, that is a request
without token, instead.

Co-authored-by: entity0xfe <entity0xfe@my.domain>
2022-10-01 20:41:02 +01:00
..
client.go lib/relay/client: Stricter typing and remove unused code (#7819) 2021-07-21 09:49:09 +02:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
dynamic.go all: Remove or convert deprecated API usages (#8459) 2022-07-28 17:14:49 +02:00
empty_test.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
methods.go lib: Factor out getting IP address from net.Addr (#8538) 2022-09-14 08:44:46 +02:00
static.go cmd/strelaysrv: Add optional auth token (fixes #3987) (#8561) 2022-10-01 20:41:02 +01:00