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

Add SSS support #129

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/single_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ jobs:
ln -s . complement-crypto

# Setup code we always need
- name: Pull synapse service v1.94.0 and mitmproxy
- name: Pull synapse service v1.114.0 and mitmproxy
shell: bash
run: |
docker pull ghcr.io/matrix-org/synapse-service:v1.94.0
docker pull ghcr.io/matrix-org/synapse-service:v1.114.0
docker pull mitmproxy/mitmproxy:10.1.5
docker tag ghcr.io/matrix-org/synapse-service:v1.94.0 homeserver:latest
docker tag ghcr.io/matrix-org/synapse-service:v1.114.0 homeserver:latest
- name: Setup | Go
uses: actions/setup-go@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ jobs:
./install_uniffi_bindgen_go.sh && ./rebuild_rust_sdk.sh ./rust-sdk

# Temporary: as it takes 3m to build the complement synapse image >:(
- name: Pull synapse service v1.94.0 and mitmproxy
- name: Pull synapse service v1.114.0 and mitmproxy
shell: bash
run: |
docker pull ghcr.io/matrix-org/synapse-service:v1.94.0
docker pull ghcr.io/matrix-org/synapse-service:v1.114.0
docker pull mitmproxy/mitmproxy:10.1.5
docker tag ghcr.io/matrix-org/synapse-service:v1.94.0 homeserver:latest
docker tag ghcr.io/matrix-org/synapse-service:v1.114.0 homeserver:latest

# Build homeserver image, honouring branch names
#- name: "Checkout corresponding Synapse branch"
Expand Down
9 changes: 9 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ You cannot currently:

## Debugging

### How do I make Synapse more chatty?

Set these env vars when running your test:
```
COMPLEMENT_SHARE_ENV_PREFIX=PASS_
PASS_SYNAPSE_LOG_LEVEL=DEBUG
PASS_SYNAPSE_LOG_SENSITIVE=1
```

### How do I access client SDK logs for the test and correlate it with the failing test line?

*You should have a file name and line number by this point.*
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ The [version] is split into the URL and TAG|BRANCH then fed directly into 'git c

### Running

Find a complement-compatible homeserver image. If you don't care which image is used, use `ghcr.io/matrix-org/synapse-service:v1.94.0`
Find a complement-compatible homeserver image. If you don't care which image is used, use `ghcr.io/matrix-org/synapse-service:v1.114.0`
which will Just Work out-of-the-box.

To run only rust tests:
```
COMPLEMENT_CRYPTO_TEST_CLIENT_MATRIX=rr \
COMPLEMENT_BASE_IMAGE=ghcr.io/matrix-org/synapse-service:v1.94.0 \
COMPLEMENT_BASE_IMAGE=ghcr.io/matrix-org/synapse-service:v1.114.0 \
LIBRARY_PATH=$LIBRARY_PATH:/path/to/matrix-rust-sdk/target/debug \
go test -v -count=1 -tags=rust -timeout 15m ./tests
```

To run only JS tests:
```
COMPLEMENT_CRYPTO_TEST_CLIENT_MATRIX=jj \
COMPLEMENT_BASE_IMAGE=ghcr.io/matrix-org/synapse-service:v1.94.0 \
COMPLEMENT_BASE_IMAGE=ghcr.io/matrix-org/synapse-service:v1.114.0 \
go test -v -count=1 -tags=jssdk -timeout 15m ./tests
```

Expand Down
14 changes: 6 additions & 8 deletions internal/api/rust/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type RustClient struct {
func NewRustClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, error) {
t.Logf("NewRustClient[%s][%s] creating...", opts.UserID, opts.DeviceID)
matrix_sdk_ffi.LogEvent("rust.go", &zero, matrix_sdk_ffi.LogLevelInfo, t.Name(), fmt.Sprintf("NewRustClient[%s][%s] creating...", opts.UserID, opts.DeviceID))
slidingSyncVersion := matrix_sdk_ffi.SlidingSyncVersionBuilderProxy{Url: opts.SlidingSyncURL}
slidingSyncVersion := matrix_sdk_ffi.SlidingSyncVersionBuilderNative{}
ab := matrix_sdk_ffi.NewClientBuilder().
HomeserverUrl(opts.BaseURL).
SlidingSyncVersionBuilder(slidingSyncVersion).
Expand Down Expand Up @@ -94,13 +94,11 @@ func NewRustClient(t ct.TestLike, opts api.ClientCreationOpts) (api.Client, erro
}
if opts.AccessToken != "" { // restore the session
session := matrix_sdk_ffi.Session{
AccessToken: opts.AccessToken,
UserId: opts.UserID,
DeviceId: opts.DeviceID,
HomeserverUrl: opts.BaseURL,
SlidingSyncVersion: matrix_sdk_ffi.SlidingSyncVersionProxy{
Url: opts.SlidingSyncURL,
},
AccessToken: opts.AccessToken,
UserId: opts.UserID,
DeviceId: opts.DeviceID,
HomeserverUrl: opts.BaseURL,
SlidingSyncVersion: matrix_sdk_ffi.SlidingSyncVersionNative{},
}
if err := client.RestoreSession(session); err != nil {
return nil, fmt.Errorf("RestoreSession: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/deploy/rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/matrix-org/complement-crypto/internal/api/langs"
)

const InactivityThreshold = 30 * time.Second
const InactivityThreshold = 60 * time.Second

// Server exposes the api.Client interface over the wire, consumed via net/rpc.
// Args and return params must be encodable with encoding/gob.
Expand Down
2 changes: 1 addition & 1 deletion tests/federation_connectivity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestNewUserCannotGetKeysForOfflineServer(t *testing.T) {
// See https://github.com/matrix-org/matrix-rust-sdk/issues/281 for why we want to backoff.
// See https://github.com/matrix-org/matrix-rust-sdk/issues/2804 for discussions on what the backoff should be.
t.Logf("sleeping until client timeout is ready...")
time.Sleep(20 * time.Second)
time.Sleep(33 * time.Second)

// send another message, bob should be able to decrypt it.
wantMsgBody = "Bob can see this because his server is now back online"
Expand Down
Loading