Skip to main content

charon service grpc client library

Project description

# Charon [![Build Status](https://travis-ci.org/piotrkowalczuk/charon.svg?branch=master)](https://travis-ci.org/piotrkowalczuk/charon)

[![GoDoc](https://godoc.org/github.com/piotrkowalczuk/charon?status.svg)](http://godoc.org/github.com/piotrkowalczuk/charon)
[![Docker Pulls](https://img.shields.io/docker/pulls/piotrkowalczuk/charon.svg?maxAge=604800)](https://hub.docker.com/r/piotrkowalczuk/charon/)
[![codecov.io](https://codecov.io/github/piotrkowalczuk/charon/coverage.svg?branch=master)](https://codecov.io/github/piotrkowalczuk/charon?branch=master)
[![Code Climate](https://codeclimate.com/github/piotrkowalczuk/charon/badges/gpa.svg)](https://codeclimate.com/github/piotrkowalczuk/charon)
[![Go Report Card](https://goreportcard.com/badge/github.com/piotrkowalczuk/charon)](https://goreportcard.com/report/github.com/piotrkowalczuk/charon)
[![pypi](https://img.shields.io/pypi/v/charon-client.svg)](https://pypi.python.org/pypi/charon-client)

<img src="/data/logo/charon.png?raw=true" width="300">

## Quick Start

### Installation

```bash
$ go install github.com/piotrkowalczuk/charon/cmd/charond
$ go install github.com/piotrkowalczuk/charon/cmd/charonctl
```

### Superuser

```bash
$ charonctl register -address=localhost:8080 -auth.disabled -register.superuser=true -register.username="j.snow@gmail.com" -register.password=123 -register.firstname=John -register.lastname=Snow
```
## Example

### Python

```python
from charonrpc import auth_pb2, auth_pb2_grpc
import grpc

charonChannel = grpc.insecure_channel('ADDRESS')
auth = auth_pb2_grpc.AuthStub(charonChannel)
try:
res = auth.Login(auth_pb2.LoginRequest(
username="USERNAME",
password="PASSWORD",
))

print "access token: %s" % res.value
except grpc.RpcError as e:
if e.code() == grpc.StatusCode.UNAUTHENTICATED:
print "login failure, username and/or password do not match"
else:
print "grpc error: %s" % e
except Exception as e:
print "unexpected error: %s" % e
```

## Contribution

@TODO

### Documentation

@TODO

### TODO
- [x] Auth
- [x] login
- [x] logout
- [x] is authenticated
- [x] subject
- [x] is granted
- [x] belongs to
- [x] Permission
- [x] get
- [x] list
- [x] register
- [x] Group
- [x] get
- [x] list
- [x] modify
- [x] delete
- [x] create
- [x] set permissions
- [x] list permissions
- [x] User
- [x] get
- [x] list
- [x] modify
- [x] delete
- [x] create
- [x] set permissions
- [x] set groups
- [x] list permissions
- [x] list groups

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charon-client-0.11.1.tar.gz (19.1 kB view details)

Uploaded Source

File details

Details for the file charon-client-0.11.1.tar.gz.

File metadata

File hashes

Hashes for charon-client-0.11.1.tar.gz
Algorithm Hash digest
SHA256 b52b1936276f348b8bf9dab340009ee959e84f6967ead7b828b1ee3ec9ff023c
MD5 5434df52f038c82c92b401d445b5895b
BLAKE2b-256 6d2cb1594cc738555a8f5b5b20c4f5955c8b4fac0914534fa30f18e56beacea1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page