-
Notifications
You must be signed in to change notification settings - Fork 2
feat: migrates creating a user using ldap #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes. I would have kept most of what you removed from the R section.
We have one user here, `Myra Francis`, username: `francism`. `francism` does not have a GUID, which means that they do not have a user account on Connect. | ||
|
||
Included in the API response for each user is a `temp_ticket` value, which can be used to create the user in Connect. | ||
The `results` object also contains a field named `temp_ticket`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still important to explain that the null
GUID is how you tell that a user doesn't have a Connect account.
The `results` object also contains a field named `temp_ticket`. | |
We can tell that the user `francism` does not have a user acocunt on Connect because their `guid` is `null`. The field `temp_ticket` can be used in a subsequent request to create an account on Connect. |
```python | ||
ticket = results[0]['temp_ticket'] | ||
``` | ||
|
||
#### Creating the user | ||
We use this value to create the user on Connect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can delete these lines (see suggestions above and below. I cannot make a suggestion here because there are unchanged lines in here).
```python | ||
response = client.put("v1/users", json={"temp_ticket": ticket}) | ||
user = response.json() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```python | |
response = client.put("v1/users", json={"temp_ticket": ticket}) | |
user = response.json() | |
```python | |
ticket = results[0]['temp_ticket'] | |
response = client.put("v1/users", json={"temp_ticket": ticket}) | |
user = response.json() |
d55e11c
to
1711e20
Compare
Note that I have some in-flight work to simply the Python implementation. Here is the groups implementation. The users implementation will be similar: posit-dev/posit-sdk-py#228