README.md 2.16 KB
Newer Older
Rob Carleski's avatar
Rob Carleski committed
1
2
# CSAM (Collaboration Services Account Manager)

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CSAM is a tool designed to manage user accounts based on a feed of changes
from the UMich directory service.

## Configuration

CSAM is intended to run as an AWS Lambda function triggered by an SQS
queue, and all of the configuration is done via environment variables.

### Eligibility Checks

The main purpose of this software is to watch for directory changes
that might affect a user's eligibility for a service. There are three
checks which can be configured individually; if multiple checks are
enabled, they may interact in interesting and unexpected ways.

#### Institutional role check

This eligibility check is enabled by default, with a set of eligible roles
associated with the Ann Arbor campus. To disable this check, set the
`ELIGIBLE_ROLES` environment variable to an empty string. To allow
a different set of roles, pass them as a comma-separated list (e.g.
`ELIGIBLE_ROLES=RegularStaffDBRN,TemporaryStaffFLNT`).

#### Campus check

This eligibility check is disabled by default. To enable it, pass
a comma-separated list of campuses in the `ELIGIBLE_CAMPUSES`
environment variable (e.g. `ELIGIBLE_CAMPUSES=FLNT`)

#### MCommunity group check

This eligibility check is disabled by default. To enable it, pass a
comma-separated list of groups in the `ELIGIBLE_GROUPS` environment variable.

### Service modules

Service modules handle the actual user management within a service.

#### Gitlab

Use the `handler.gitlab` entry point, and set the `GL_SERVICE_URL` and
`GL_API_TOKEN` environment variables.

#### Slack

Use the `handler.slack` entry point, and set the `SLACK_API_TOKEN` environment
variable.
Rob Carleski's avatar
Rob Carleski committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

## Setting up your environment

CSAM requires Python 3.

For development, we recommend using a virtualenv.

* Run `init.sh` to set up the virtualenv.
* When you want to hack on CSAM, source env-setup.sh
  (`. env-setup.sh`) to set up the necessary environment variables.

## Testing

Tests can be run with `python setup.py test`.

CSAM uses the [pytest](https://pytest.org/) testing framework, so
tests can also be run directly with the command `pytest`.
67
68
69

To run the Slack integration tests, set the `SLACK_API_TOKEN`
environment variable.