Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centrifugo V4 #519

Merged
merged 48 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
99cdc1d
start working on v4
FZambia Jun 1, 2022
7096411
pass context to runConcurrentlyIfNeeded
FZambia Jun 4, 2022
3160ea8
sub token user check
FZambia Jun 4, 2022
aba08b7
fix tests
FZambia Jun 5, 2022
c6c92e2
distinguish between connect and subscribe tokens
FZambia Jun 9, 2022
22eedab
fix configuration
FZambia Jun 12, 2022
8a1f217
fix configuration
FZambia Jun 12, 2022
0748e6e
Merge branch 'master' into v4_dev
FZambia Jun 12, 2022
3aff5f9
change module path to v4
FZambia Jun 12, 2022
6e33e1b
update unistream proto
FZambia Jun 12, 2022
76b94e9
better error handling in cli token gen funcs
FZambia Jun 13, 2022
3b8a790
bad request when channel name invalid
FZambia Jun 14, 2022
503dfbf
experimental http/3 support
FZambia Jun 16, 2022
905d797
re-use http server
FZambia Jun 16, 2022
d066b08
fix data race in tnt broker tests
FZambia Jun 17, 2022
dce2b1b
up centrifuge
FZambia Jun 22, 2022
2df4184
uni_websocket: use protocol v2 by default
FZambia Jun 22, 2022
183a944
up centrifuge
FZambia Jun 25, 2022
d30f6eb
changelog, release notes
FZambia Jun 25, 2022
5d73fc8
proxy error temporary flag
FZambia Jun 27, 2022
401fb82
up centrifuge
FZambia Jun 30, 2022
c4072f8
refactor channel options and overrides
FZambia Jul 1, 2022
9d3eae7
fix tests
FZambia Jul 1, 2022
6ae18b8
fix proxy tests
FZambia Jul 1, 2022
5e1047e
update meta on refresh
FZambia Jul 2, 2022
871233e
pin to latest centrifuge
FZambia Jul 3, 2022
880b357
refactor keeping compiled regexes
FZambia Jul 3, 2022
98dfbc7
Merge branch 'master' into v4_dev
FZambia Jul 3, 2022
48b705b
update web, update api proto
FZambia Jul 6, 2022
375dda8
add missing json tag, update notes and changelog
FZambia Jul 6, 2022
abb526c
update notes
FZambia Jul 7, 2022
22201de
prepare for beta: disable docker latest and brew
FZambia Jul 9, 2022
d7c4052
auto prerelease flag in goreleaser
FZambia Jul 9, 2022
0fef0b1
up centrifuge
FZambia Jul 9, 2022
3265ab3
update readme and notes
FZambia Jul 10, 2022
aa54890
update readme and notes
FZambia Jul 10, 2022
60f8e1b
update dependencies
FZambia Jul 11, 2022
7dce20b
update centrifuge
FZambia Jul 13, 2022
e32cc3b
import layout
FZambia Jul 14, 2022
17ffad1
update readme and notes
FZambia Jul 15, 2022
2292dae
default for history_meta_ttl
FZambia Jul 16, 2022
bb1ca1c
use go 1.18.4
FZambia Jul 18, 2022
de021f6
uncomment docker latest release and brew
FZambia Jul 19, 2022
45bb55a
check http3 is enabled when webtransport is on
FZambia Jul 19, 2022
e174057
update release notes and changelog
FZambia Jul 19, 2022
48b57b7
Merge branch 'master' into v4_dev
FZambia Jul 19, 2022
e57399b
update release notes and changelog
FZambia Jul 19, 2022
ab69226
up centrifuge
FZambia Jul 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.17.10]
go-version: [1.18.3]
steps:
- name: Install rpm
run: sudo apt-get install rpm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17.x'
go-version: '1.18.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -23,7 +23,7 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
go-version: [1.17.10]
go-version: [1.18.3]
tarantool-version: [2.7.2]
steps:
- name: Install Go
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module github.com/centrifugal/centrifugo/v3

go 1.17
go 1.18

require (
github.com/FZambia/eagle v0.0.2
Expand Down
9 changes: 0 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ github.com/centrifugal/centrifuge v0.22.3-0.20220528054326-4cb1c3bf6088 h1:rJg56
github.com/centrifugal/centrifuge v0.22.3-0.20220528054326-4cb1c3bf6088/go.mod h1:EdNk7F2Mep5uBuLRuzNrCutyqLDPofx63cd7FnDm6SY=
github.com/centrifugal/protocol v0.8.7 h1:re4e1SDGd3eKpQT/xbrY7BE2KBuXurH5WKqDKg6ihOs=
github.com/centrifugal/protocol v0.8.7/go.mod h1:xLAQaeaSDQ++cPN5ChSd4GR1TCuItVu1FCx/c9kOcM0=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
Expand Down Expand Up @@ -210,7 +209,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4=
github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
Expand All @@ -227,7 +225,6 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
Expand All @@ -242,7 +239,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I=
github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k=
github.com/nats-io/nats-server/v2 v2.8.1 h1:WZ9m/d8rklkWo6opo3X927vXnuaE00VEEl5zXcpL6qw=
github.com/nats-io/nats-server/v2 v2.8.1/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4=
github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw=
Expand Down Expand Up @@ -371,7 +367,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA=
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -442,7 +437,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 h1:yssD99+7tqHWO5Gwh81phT+67hg+KttniBr6UnEXOY8=
Expand Down Expand Up @@ -471,7 +465,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -513,7 +506,6 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -533,7 +525,6 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M=
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
22 changes: 11 additions & 11 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (h *Executor) Publish(_ context.Context, cmd *PublishRequest) *PublishRespo
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down Expand Up @@ -157,7 +157,7 @@ func (h *Executor) Broadcast(_ context.Context, cmd *BroadcastRequest) *Broadcas
return
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
h.node.Log(centrifuge.NewLogEntry(centrifuge.LogLevelError, "error getting options for channel", map[string]interface{}{"channel": ch, "error": err.Error()}))
responses[i] = &PublishResponse{Error: ErrorInternal}
Expand Down Expand Up @@ -215,7 +215,7 @@ func (h *Executor) Subscribe(_ context.Context, cmd *SubscribeRequest) *Subscrib
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(channel)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(channel)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand All @@ -233,11 +233,11 @@ func (h *Executor) Subscribe(_ context.Context, cmd *SubscribeRequest) *Subscrib
if cmd.Override != nil && cmd.Override.JoinLeave != nil {
joinLeave = cmd.Override.JoinLeave.Value
}
useRecover := chOpts.Recover
useRecover := chOpts.ForceRecovery
if cmd.Override != nil && cmd.Override.Recover != nil {
useRecover = cmd.Override.Recover.Value
}
position := chOpts.Position
position := chOpts.ForcePositioning
if cmd.Override != nil && cmd.Override.Position != nil {
position = cmd.Override.Position.Value
}
Expand Down Expand Up @@ -271,7 +271,7 @@ func (h *Executor) Subscribe(_ context.Context, cmd *SubscribeRequest) *Subscrib
}

// Unsubscribe unsubscribes user from channel and sends unsubscribe
// control message to other nodes so they could also unsubscribe user.
// control message to other nodes, so they could also unsubscribe user.
func (h *Executor) Unsubscribe(_ context.Context, cmd *UnsubscribeRequest) *UnsubscribeResponse {
defer observe(time.Now(), h.protocol, "unsubscribe")

Expand All @@ -281,7 +281,7 @@ func (h *Executor) Unsubscribe(_ context.Context, cmd *UnsubscribeRequest) *Unsu
channel := cmd.Channel

if channel != "" {
_, _, found, err := h.ruleContainer.ChannelOptions(channel)
_, _, _, found, err := h.ruleContainer.ChannelOptions(channel)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down Expand Up @@ -369,7 +369,7 @@ func (h *Executor) Presence(_ context.Context, cmd *PresenceRequest) *PresenceRe
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down Expand Up @@ -420,7 +420,7 @@ func (h *Executor) PresenceStats(_ context.Context, cmd *PresenceStatsRequest) *
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down Expand Up @@ -463,7 +463,7 @@ func (h *Executor) History(_ context.Context, cmd *HistoryRequest) *HistoryRespo
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down Expand Up @@ -542,7 +542,7 @@ func (h *Executor) HistoryRemove(_ context.Context, cmd *HistoryRemoveRequest) *
return resp
}

_, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
_, _, chOpts, found, err := h.ruleContainer.ChannelOptions(ch)
if err != nil {
resp.Error = ErrorInternal
return resp
Expand Down
2 changes: 1 addition & 1 deletion internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (t testSurveyCaller) Channels(_ context.Context, _ *ChannelsRequest) (map[s
return nil, nil
}

func (t testSurveyCaller) UserConnections(_ context.Context, _ *UserConnectionsRequest) (map[string]*UserConnectionInfo, error) {
func (t testSurveyCaller) Connections(_ context.Context, _ *ConnectionsRequest) (map[string]*ConnectionInfo, error) {
return nil, nil
}

Expand Down
Loading