mirror of
https://github.com/ViViDboarder/bitwarden_rs_ldap.git
synced 2024-11-23 11:46:27 +00:00
Update testing instructions and bump 1.0
This commit is contained in:
parent
f7b7f28e77
commit
30974696be
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -984,7 +984,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vaultwarden_ldap"
|
||||
version = "0.6.2"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"envy",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vaultwarden_ldap"
|
||||
version = "0.6.2"
|
||||
version = "1.0.0"
|
||||
authors = ["ViViDboarder <vividboarder@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
18
Makefile
18
Makefile
@ -38,14 +38,28 @@ test:
|
||||
itest:
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest.yml \
|
||||
up --build
|
||||
build
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest.yml \
|
||||
up -d vaultwarden ldap
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest.yml \
|
||||
run ldap_sync
|
||||
docker-compose stop
|
||||
|
||||
# Run bootstrapped integration test using env for config
|
||||
.PHONY: itest-env
|
||||
itest-env:
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest-env.yml \
|
||||
up --build
|
||||
build
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest-env.yml \
|
||||
up -d vaultwarden ldap
|
||||
docker-compose -f docker-compose.yml \
|
||||
-f itest/docker-compose.itest-env.yml \
|
||||
run ldap_sync
|
||||
docker-compose stop
|
||||
|
||||
.PHONY: clean-itest
|
||||
clean-itest:
|
||||
|
18
README.md
18
README.md
@ -44,7 +44,18 @@ For those less familiar with `cargo`, you can use the `make` targets that have b
|
||||
|
||||
## Testing
|
||||
|
||||
All testing is manual right now. First step is to set up Bitwarden and the LDAP server.
|
||||
There are no unit tests, but there are integration tests that require manual verification.
|
||||
|
||||
### Integration tests
|
||||
|
||||
Running `make itest` will spin up an ldap server with a test user, a Vaultwarden server, and then run the sync. If successful the log should show an invitation sent to the test user. If you run `make itest` again, it should show no invites sent because the user already has been invited. If you'd like to reset the testing, `make clean-itest` will clear out the Vaultwarden database and start fresh.
|
||||
|
||||
It's also possible to test passing configs via enviornment variables by running `make itest-env`. The validation steps are the same.
|
||||
|
||||
|
||||
### Steps for manual testing
|
||||
|
||||
The first step is to set up Bitwarden and the LDAP server.
|
||||
|
||||
```bash
|
||||
docker-compose up -d vaultwarden ldap ldap_admin
|
||||
@ -74,8 +85,3 @@ docker-compose up ldap_sync
|
||||
Alternately, you can bootstrap some of this by running:
|
||||
|
||||
docker-compose -f docker-compose.yml -f itest/docker-compose.itest.yml up --build
|
||||
|
||||
## Future
|
||||
|
||||
* Any kind of proper logging
|
||||
* Tests
|
||||
|
@ -24,6 +24,7 @@ services:
|
||||
ADMIN_TOKEN: admin
|
||||
SIGNUPS_ALLOWED: 'false'
|
||||
INVITATIONS_ALLOWED: 'true'
|
||||
I_REALLY_WANT_VOLATILE_STORAGE: 'true'
|
||||
|
||||
ldap:
|
||||
image: osixia/openldap
|
||||
|
@ -11,7 +11,7 @@ services:
|
||||
APP_LDAP_BIND_PASSWORD: "admin"
|
||||
APP_LDAP_SEARCH_BASE_DN: "dc=example,dc=org"
|
||||
APP_LDAP_SEARCH_FILTER: "(&(objectClass=*)(uid=*))"
|
||||
APP_LDAP_SYNC_INTERVAL_SECONDS: 10
|
||||
APP_LDAP_SYNC_LOOP: "false"
|
||||
|
||||
vaultwarden:
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
version: '3'
|
||||
services:
|
||||
ldap_sync:
|
||||
volumes:
|
||||
- ./itest/config.toml:/config.toml:ro
|
||||
|
||||
vaultwarden:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user