Mozilla IAM user profile ('v2') class utility.
Project description
# moz_iam_profile
This library is a dynamic class-constructor for the Mozilla IAM profiles (v2).
It takes the Mozilla IAM default profile and schema, and creates a Python class from it dynamically.
This means that the default profile (JSON file: user_profile_null.json) and schema can be changed without
affecting the class code (to some degree).
## Example usage
### Using profiles
```
from cis_profile import User
skel_user = User(user_id="bobsmith")
skel_user.user_id.value = "notbobsmith"
if skel_user.validate():
profile = skel_user.as_json()
user = { exiting...user..json }
skel_user2 = User(profile_structure_json=user)
skel_user2.fun_title.value = 'New title!'
skel_user2.sign_attribute('fun_title')
```
### Faking profiles
```
from cis_profile import FakeUser
user = FakeUser()
print(user.first_name.value)
# Jim
```
## About tests
`cis_crypto` must be setup and function for tests to run, see the `cis_crypto` module if is it not setup (in particular
keys must be created)
This library is a dynamic class-constructor for the Mozilla IAM profiles (v2).
It takes the Mozilla IAM default profile and schema, and creates a Python class from it dynamically.
This means that the default profile (JSON file: user_profile_null.json) and schema can be changed without
affecting the class code (to some degree).
## Example usage
### Using profiles
```
from cis_profile import User
skel_user = User(user_id="bobsmith")
skel_user.user_id.value = "notbobsmith"
if skel_user.validate():
profile = skel_user.as_json()
user = { exiting...user..json }
skel_user2 = User(profile_structure_json=user)
skel_user2.fun_title.value = 'New title!'
skel_user2.sign_attribute('fun_title')
```
### Faking profiles
```
from cis_profile import FakeUser
user = FakeUser()
print(user.first_name.value)
# Jim
```
## About tests
`cis_crypto` must be setup and function for tests to run, see the `cis_crypto` module if is it not setup (in particular
keys must be created)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cis_profile-0.0.3.1.tar.gz
(21.4 kB
view details)
File details
Details for the file cis_profile-0.0.3.1.tar.gz.
File metadata
- Download URL: cis_profile-0.0.3.1.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2d95a8aa4bb7f50a9f1788436a023d21c9e43a27b504d090c9c1d57e210d617
|
|
| MD5 |
4892d93a6a85a528d04227e3398e014c
|
|
| BLAKE2b-256 |
67318f27a627fe17bc90aba85e79db871b7a7d17834c02f9ffa8b3e1740215a4
|