Skip to content

feat: support dynamic user management in Weaviate 1.30 #278

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

Merged
merged 23 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2ab5781
chore: update OpenAPI schema
bevzzz Mar 31, 2025
1929a22
feat: enable dynamic user management, add db/oidc namespaces
bevzzz Mar 31, 2025
a9cf76c
refactor: re-use common code snippets
bevzzz Mar 31, 2025
fd3ff06
test: extend integration test suite
bevzzz Mar 31, 2025
b1ece85
refactor(test): use concise Promise.all
bevzzz Mar 31, 2025
d61c30f
feat(breaking): include user types in user assignments
bevzzz Mar 31, 2025
795fdb7
chore: format and lint
bevzzz Apr 1, 2025
5562ec9
test: activate test case for 'oidc' users
bevzzz Apr 1, 2025
6733882
chore: lint and format
bevzzz Apr 1, 2025
df010a2
refactor: replace .reduce with .map where possible
bevzzz Apr 1, 2025
dffc2c1
test: use valid tenant name
bevzzz Apr 1, 2025
29f3cfc
refactor: collect optional parameters in an object
bevzzz Apr 1, 2025
d32ac42
test: add test case w/ includePermissions=true
bevzzz Apr 1, 2025
5bc5b08
chore: lint and format
bevzzz Apr 1, 2025
53049e3
fix: expect no response for /activate and /deactivate
bevzzz Apr 2, 2025
c0ca1ef
fix: allow expected code only for instances of WeaviateUnexpectedStat…
bevzzz Apr 2, 2025
28c3897
refactor: declare types in **/types.ts
bevzzz Apr 2, 2025
84aac0d
test: await on all expectations which should resolve/reject
bevzzz Apr 2, 2025
2e71143
refactor: replace postNoBody with a more explicit postReturn<null, R>
bevzzz Apr 2, 2025
bf294e9
chore: add documentation for dynamic user management
bevzzz Apr 2, 2025
67b675e
chore: lint and format
bevzzz Apr 2, 2025
aa04c92
test: use different port binding for backup/unit.test.ts
bevzzz Apr 3, 2025
a140c53
feat: add revokeKey option to /deactivate
bevzzz Apr 3, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
checks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -139,4 +139,4 @@ jobs:
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: true
draft: true
Empty file modified ci/compose.sh
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions ci/docker-compose-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ services:
AUTHORIZATION_RBAC_ENABLED: "true"
AUTHORIZATION_ADMIN_USERS: "admin-user"
AUTHORIZATION_VIEWER_USERS: "viewer-user"
AUTHENTICATION_DB_USERS_ENABLED: "true"
AUTHENTICATION_OIDC_ENABLED: "true"
AUTHENTICATION_OIDC_CLIENT_ID: "wcs"
AUTHENTICATION_OIDC_ISSUER: "https://auth.wcs.api.weaviate.io/auth/realms/SeMI"
AUTHENTICATION_OIDC_USERNAME_CLAIM: "email"
AUTHENTICATION_OIDC_GROUPS_CLAIM: "groups"
...
6 changes: 3 additions & 3 deletions src/collections/backup/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ describe('Mock testing of backup cancellation', () => {
let mock: CancelMock;

beforeAll(async () => {
mock = await CancelMock.use('1.27.0', 8958, 8959);
client = await weaviate.connectToLocal({ port: 8958, grpcPort: 8959 });
mock = await CancelMock.use('1.27.0', 8912, 8913);
client = await weaviate.connectToLocal({ port: 8912, grpcPort: 8913 });
});

it('should throw while waiting for creation if backup is cancelled in the meantime', async () => {
Expand All @@ -133,7 +133,7 @@ describe('Mock testing of backup cancellation', () => {
});

it('should return false if creation backup does not exist', async () => {
const success = await client.backup.cancel({ backupId: `${BACKUP_ID}4`, backend: BACKEND });
const success = await client.backup.cancel({ backupId: `${BACKUP_ID}-unknown`, backend: BACKEND });
expect(success).toBe(false);
});

Expand Down
6 changes: 2 additions & 4 deletions src/connection/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ export default class ConnectionREST {

postReturn = <B, T>(path: string, payload: B): Promise<T> => {
if (this.authEnabled) {
return this.login().then((token) =>
this.http.post<B, T>(path, payload, true, token).then((res) => res as T)
);
return this.login().then((token) => this.http.post<B, T>(path, payload, true, token) as T);
}
return this.http.post<B, T>(path, payload, true, '').then((res) => res as T);
return this.http.post<B, T>(path, payload, true, '') as Promise<T>;
};

postEmpty = <B>(path: string, payload: B): Promise<void> => {
Expand Down
Loading