Ory Keto
支持的数据库:PostgreSQL、MySQL、CockroachDB、SQLite。
其中,开发时可以使用SQLite,而运营时最好不要使用。
安装部署Keto服务
具体文档可见:https://www.ory.sh/docs/keto/install
最基本的keto.yml
version: v0.10.0-alpha.0
log:
level: debug
namespaces:
- id: 0
name: app
serve:
read:
host: 0.0.0.0
port: 4466
write:
host: 0.0.0.0
port: 4467
dsn: memory
需要注意的是,新的版本当中,必须要有namespaces的定义,不然启动不了。
Docker
直接docker run启动
docker pull oryd/keto:latest
docker run -itd --name keto-server `
-p 4466:4466 -p 4467:4467 `
-v /d/keto.yml:/home/ory/keto.yml `
oryd/keto:latest serve -c /home/ory/keto.yml
需要注意的是,我把宿主的keto.yml直接挂载上去了,不然启动不了。
docker-compose启动
version: "3"
services:
keto:
image: oryd/keto:v0.10.0-alpha.0
ports:
- "4466:4466"
- "4467:4467"
command: serve -c /home/ory/keto.yml
restart: on-failure
volumes:
- type: bind
source: .
target: /home/ory
Linux
bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -d -b . keto v0.10.0-alpha.0
./keto help
macOS
brew install ory/tap/keto
keto help
Windows
irm get.scoop.sh | iex
scoop bucket add ory https://github.com/ory/scoop.git
scoop install keto
keto help
我尝试了使用sqlite启动,结果说没有支持:could not create new connection: sqlite3 support was not compiled into the binary stack_trace
Kubernetes
helm repo add ory https://k8s.ory.sh/helm/charts
helm repo update
安装SDK
安装gRPC API
go get github.com/ory/keto/[email protected]
安装REST API
go get github.com/ory/[email protected]
参考资料