Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alexlouden/authserver

Simple authentication service using Django Rest Framework
https://github.com/alexlouden/authserver

Last synced: about 9 hours ago
JSON representation

Simple authentication service using Django Rest Framework

Awesome Lists containing this project

README

        

Authserver
==========

# /api/user

```
{
id: 1,
name: "Alex",
email: "[email protected]",
roles: [
"admin",
"test"
],
data: {
rate_limit: 19
}
}
```

Root:

- List
GET `/api/user`

- Create
POST `api/user`

Detail:

- Fetch
GET `/api/user/`

- Update
PUT `/api/user/`

- Delete
DELETE `/api/user/`

Passwords:

- Change password
POST `/api/user//set_password`
Data: `{ password: }`

- Check password
POST `/api/user//check_password`
Data: `{ password: }`

Roles:

- Fetch user roles
GET `/api/user//roles`

- Check user has role
POST `/api/user//check_role`
Data: `{ name: }`

- Add user role
POST `/api/user//add_role`
Data: `{ name: }`

- Remove user role
POST `/api/user//remove_role`
Data: `{ name: }`

Keys:

- Fetch keys
GET `/api/user/id/keys`

```
[
{
key: "key",
secret: "secret"
}
]
```

- Create key
POST `/api/user/id/create_key`
Data: `{ key: , secret: }`

# /api/role

```
{
count: 2,
next: null,
previous: null,
results: [
{
id: 1,
name: "admin"
},
{
id: 2,
name: "test"
}
]
}
```

Root:

- List
GET `/api/role`

- Create
POST `api/role`

Detail: (look up via role name)

- Fetch
GET `/api/role/`

- Update
PUT `/api/role/`

- Delete
DELETE `/api/role/`

# /api/key

Root:

- List
GET `/api/key`

```
{
count: 1,
next: null,
previous: null,
results: [
{
key: "key",
secret: "secret",
user: {
id: 1,
name: "Alex",
email: "[email protected]",
roles: [
"admin",
"test"
],
data: {
rate_limit: 19
}
}
}
]
}
```

Detail: (look up via key)

- Fetch - GET `/api/key/`

- Check secret
POST `/api/key//check_secret`
Data: `{ secret: }`