How a request moves
Filing a request starts its approval workflow. From there:- Approval. Each approval stage creates an
access-request-approvaltask for the stage’s approvers. A request that needs no approval moves directly toapproved. - Provisioning. When Lumos can grant the access itself, for example through the app’s
integration, provisioning runs automatically. Otherwise Lumos creates a task, such as
manual-provisioningoraccount-creation, for someone to grant it by hand. The app’s admins get that task unless the workflow names someone else. - Removal. When time-based access ends, Lumos removes it automatically or creates a
deprovisioning task, such as
manual-deprovisioningoraccount-deprovisioning, for someone to remove it by hand.
File a request and follow it
The code on this page uses Python 3 and therequests library. It reads your API token from the
LUMOS_API_TOKEN environment variable, as Authentication
describes, and stops on any error, including a 429.
Rate limits explains how to wait and retry instead.
Create Access Request takes the app, the
entitlements you want on it, and a business justification:
File a request
entitlement_ids takes entitlement IDs, as
List Entitlements returns them. Omit it to
request the app itself. Filing a request
covers the other fields and the errors each can return, and
Time-based access covers
access_length.
The API doesn’t send an event when a request changes status or when Lumos creates a task. To follow
a request, poll it. Each poll counts against your
rate limit, so increase the wait after each poll:
Follow a request
follow() returns when the request reaches a status that isn’t cancellable, such as completed,
denied, expired, or cancelled. A request for time-based access moves back to an in-progress
status when its access ends. A request can wait on a person for days, so follow() raises
TimeoutError if the request is still in progress after max_wait seconds.
The tasks on a request
Two calls return a request’s tasks:- Get Access Request with
expand=tasksreturns them in any status. - List Tasks with
access_request_idreturns the open ones, unless you passstatus.
An approval bot
An approval bot finds its tasks with List Tasks and approves them with Perform Task Action. A token acts as its user, so a bot sees and acts on the same tasks its user can. Which tasks you can see lists the rules for each role and kind of assignment. A bot running as the current approver can read the request with Get Access Request, using the task’saccess_request_id. Once the request no longer waits on the bot, the bot needs another way to see
it, as Who can see a request
describes.
This script approves requests for a list of apps and leaves every other request for a person:
Approval bot
400 rather than a wider list, as
Filtering the list describes. The bot checks each
task’s type and status before it acts.
Manager approvals are access-request-approval tasks too. Some older manager approvals that are
still open have the type manager-approval instead. List that type as well if the bot should
handle them.