Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wire-specific schemas to SCIM user records #741

Merged
merged 1 commit into from
May 2, 2019
Merged

Add Wire-specific schemas to SCIM user records #741

merged 1 commit into from
May 2, 2019

Conversation

neongreen
Copy link
Contributor

This is a minor bug that manifests when a user is provisioned via SCIM.

When a user is provisioned via SCIM, our backend receives a user record that includes the "schemas" field. It might include "urn:wire:scim:schemas:profile:1.0", or it might not.

Before this PR, we just wrote the received user record into the database. After this PR, we also make sure to overwrite the list of schemas with schemas we actually support. (Even if the received record doesn't have "richInfo", we still return it – so we have to signal "richInfo" support in the schema.)

This is a freshly created SCIM user record in Spar database, before and after this PR:

{
-   "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ],
+   "schemas": [
+        "urn:ietf:params:scim:schemas:core:2.0:User",
+        "urn:wire:scim:schemas:profile:1.0"
+   ],
    "id": "ef4bafda-5be8-46e3-bed2-5bcce55cff01",
    "externalId": "lana@example.com",
    "userName": "lana_d",
    "displayName": "Lana Donohue",
    "urn:wire:scim:schemas:profile:1.0": {
        "richInfo": {
            "version": 0,
            "fields": [
                { "type": "Title", "value": "Chief Backup Officer" },
                { "type": "Favorite quote", "value": "Monads are just giant burritos" }
            ]
        }
    },
    "meta": {
        "resourceType": "User",
        "location": "https://staging-nginz-https.zinfra.io/scim/v2/Users/ef4bafda-5be8-46e3-bed2-5bcce55cff01",
        "created": "2019-04-21T04:15:12.535509602Z",
        "lastModified": "2019-04-21T04:15:18.185055531Z",
        "version": "W/\"e051bc17f7e07dec815f4b9314f76f88e2949a62b6aad8c816086cff85de4783\""
    }
}

@fisx fisx merged commit 6dfff73 into develop May 2, 2019
@fisx fisx deleted the schemas branch May 2, 2019 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants