Skip to content

Instantly share code, notes, and snippets.

@tahmmee
Last active April 11, 2017 17:32
Show Gist options
  • Save tahmmee/e7c6513b18fa11e693065b73b1a746bd to your computer and use it in GitHub Desktop.
Save tahmmee/e7c6513b18fa11e693065b73b1a746bd to your computer and use it in GitHub Desktop.
rbac with python sdk
from couchbase.cluster import Cluster, ClassicAuthenticator, PasswordAuthenticator
host = "172.17.0.2"
port = 8091
bucket = "default"
password = "password"
bucket_password = ""
endpoint = 'couchbase://{0}?select_bucket=true'.format(host )
cluster = Cluster(endpoint)
auther = PasswordAuthenticator(bucket,password)
cluster.authenticate(auther)
cb = cluster.open_bucket(bucket)
cb.upsert("key", "value")
"""
requires
./couchbase-cli/couchbase-cli user-manage -c 172.17.0.2 -u Administrator -p password --set --rbac-username default --rbac-password password --roles admin --auth-type builtin
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment