Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fbiville/neo4j-impersonation-demo
Quick demo of Neo4j 4.4 new impersonation feature in Go
https://github.com/fbiville/neo4j-impersonation-demo
Last synced: 17 days ago
JSON representation
Quick demo of Neo4j 4.4 new impersonation feature in Go
- Host: GitHub
- URL: https://github.com/fbiville/neo4j-impersonation-demo
- Owner: fbiville
- License: apache-2.0
- Created: 2021-12-13T14:16:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-14T10:02:57.000Z (almost 3 years ago)
- Last Synced: 2024-10-15T01:16:09.137Z (about 1 month ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Neo4j 4.4 impersonation demo
This is a simple application that demonstrates how to configure impersonation.
## Database setup
Start a [Neo4j](https://neo4j.com) server.
On the system DB, run:
```cypher
-- create home DBs & users & roles
CREATE DATABASE joesDb
CREATE DATABASE janesDb
CREATE USER joe SET PASSWORD 'joespass' SET HOME DATABASE joesDb
CREATE USER jane SET PASSWORD 'janespass' SET HOME DATABASE janesDb
CREATE ROLE impersonated
GRANT ROLE impersonated TO joe,jane
GRANT ALL GRAPH PRIVILEGES ON HOME GRAPH TO impersonated
CREATE ROLE impersonator
GRANT IMPERSONATE (joe, jane) ON DBMS TO impersonator
GRANT ROLE impersonator TO neo4j
-- init data ("joesDb" DB)
```On `joesDb` DB:
```cypher
CREATE (:FavouriteMovie {title: 'Alien vs. Predator vs. CVE-2021-44228'})
```On `janesDb` DB:
```cypher
CREATE (:FavouriteMovie {title: 'Roundhay Garden Scene'})
```
On `neo4j` DB:
```cypher
CREATE (:FavouriteMovie {title: 'The Matrix'})
```## Run
`neo4j` impersonating `joe` in autocommit transaction:
```shell
go run ./cmd/autocommit
````neo4j` impersonating `jane` in a transaction function:
```shell
go run ./cmd/tx_func
```