Skip to content

Commit

Permalink
🎉 Source Okta: add GroupMembers stream (#14380)
Browse files Browse the repository at this point in the history
* add Group_Members stream to okta source

- Group_Members return a list of users, the same schema of Users stream.
- Create a shared schema users, and both group_members and users sechema use it as a reference.
- Add Group_Members stream to source connector

* add tests and fix logs schema

- fix the test error: None is not one of enums though the enum type includes both string and null, it comes from json schema validator
https://github.com/python-jsonschema/jsonschema/blob/ddb87afad8f5d5c40600b5ede0ab96e4d4bdf7d3/jsonschema/_validators.py#L279-L285
- change grouop_members to use id as the cursor field since `filter` is not supported in the query string
- fix the abnormal state test on logs stream, when since is abnormally large, until has to defined, an equal or a larger value
- remove logs stream from full sync test, because 2 full sync always has a gap -- at least a new log about users or groups api.

* last polish before submit the PR

- bump docker version
- update changelog
- add the right abnormal value for logs stream
- correct the sample catalog

* address comments::

- improve comments for until parameter under the logs stream
- add use_cache on groupMembers

* add use_cache to Group_Members

* change configured_catalog to test

* auto-bump connector version

Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
  • Loading branch information
3 people authored and girarda committed Jul 12, 2022
1 parent 2d2ef71 commit 8b422c7
Show file tree
Hide file tree
Showing 15 changed files with 336 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@
- name: Okta
sourceDefinitionId: 1d4fdb25-64fc-4569-92da-fcdca79a8372
dockerRepository: airbyte/source-okta
dockerImageTag: 0.1.4
dockerImageTag: 0.1.5
documentationUrl: https://docs.airbyte.io/integrations/sources/okta
icon: okta.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5907,7 +5907,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-okta:0.1.4"
- dockerImage: "airbyte/source-okta:0.1.5"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/okta"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-okta/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.4
LABEL io.airbyte.version=0.1.5
LABEL io.airbyte.name=airbyte/source-okta
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
future_state_path: "integration_tests/abnormal_state.json"
cursor_paths:
users: ["lastUpdated"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"users": { "lastUpdated": "3021-09-08T07:04:28.000Z" },
"groups": { "lastUpdated": "3021-09-08T07:04:28.000Z" }
"groups": { "lastUpdated": "3021-09-08T07:04:28.000Z" },
"group_members": { "id": "00uzzzzzzzzzzzzzzzzz" },
"logs": { "published": "3021-09-08T07:04:28.000Z" }
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["lastUpdated"],
"primary_key": [["id"]]
},
{
"stream": {
"name": "groupMembers",
"json_schema": {}
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["id"],
"primary_key": [["id"]]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "full_refresh",
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["lastUpdated"],
"primary_key": [["id"]]
Expand All @@ -32,6 +32,17 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["published"],
"primary_key": [["uuid"]]
},
{
"stream": {
"name": "group_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["id"],
"primary_key": [["id"]]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["lastUpdated"],
"primary_key": [["id"]]
},
{
"stream": {
"name": "group_members",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "incremental",
"destination_sync_mode": "overwrite",
"cursor_field": ["id"],
"primary_key": [["id"]]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"base_url": "https://myorg.okta.com",
"token": "xyz123foo325a.fbar"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$ref": "users.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"LDAP",
"FEDERATION",
"SOCIAL",
"FACTOR_PROVIDER"
"FACTOR_PROVIDER",
null
],
"type": ["string", "null"]
},
Expand All @@ -47,7 +48,8 @@
"SYMANTEC",
"GOOGLE",
"DUO",
"YUBIKEY"
"YUBIKEY",
null
],
"type": ["string", "null"]
},
Expand All @@ -60,7 +62,8 @@
"IWA",
"EMAIL",
"OAUTH2",
"JWT"
"JWT",
null
],
"type": ["string", "null"]
},
Expand Down Expand Up @@ -149,7 +152,7 @@
"properties": {
"debugData": {
"additionalProperties": {
"type": ["object", "null"]
"type": ["object", "null", "string"]
},
"type": ["object", "null"]
}
Expand Down Expand Up @@ -264,7 +267,7 @@
},
"detailEntry": {
"additionalProperties": {
"type": ["object", "null"]
"type": ["object", "null", "string"]
},
"type": ["object", "null"]
},
Expand All @@ -286,7 +289,7 @@
"properties": {
"detail": {
"additionalProperties": {
"type": ["object", "null"]
"type": ["object", "null", "string"]
},
"type": ["object", "null"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
{
"properties": {
"_links": {
"additionalProperties": {
"type": ["object", "null"]
},
"type": ["object", "null"]
},
"activated": {
"format": "date-time",
"type": ["string", "null"]
},
"created": {
"format": "date-time",
"type": "string"
},
"credentials": {
"properties": {
"password": {
"properties": {
"hash": {
"properties": {
"algorithm": {
"enum": ["BCRYPT", "SHA-512", "SHA-256", "SHA-1", "MD5"],
"type": ["string", "null"]
},
"salt": {
"type": ["string", "null"]
},
"saltOrder": {
"type": ["string", "null"]
},
"value": {
"type": ["string", "null"]
},
"workFactor": {
"type": ["integer", "null"]
}
},
"type": ["object", "null"]
},
"hook": {
"properties": {
"type": {
"type": ["string", "null"]
}
},
"type": ["object", "null"]
},
"value": {
"format": "password",
"type": ["string", "null"]
}
},
"type": ["object", "null"]
},
"provider": {
"properties": {
"name": {
"type": ["string", "null"]
},
"type": {
"enum": [
"ACTIVE_DIRECTORY",
"FEDERATION",
"LDAP",
"OKTA",
"SOCIAL",
"IMPORT"
],
"type": ["string", "null"]
}
},
"type": ["object", "null"]
},
"recovery_question": {
"properties": {
"answer": {
"type": ["string", "null"]
},
"question": {
"type": ["string", "null"]
}
},
"type": ["object", "null"]
}
},
"type": "object"
},
"id": {
"type": "string"
},
"lastLogin": {
"format": "date-time",
"type": ["string", "null"]
},
"lastUpdated": {
"format": "date-time",
"type": "string"
},
"passwordChanged": {
"format": "date-time",
"type": ["string", "null"]
},
"profile": {
"properties": {
"city": {
"type": ["string", "null"]
},
"costCenter": {
"type": ["string", "null"]
},
"countryCode": {
"type": ["string", "null"]
},
"department": {
"type": ["string", "null"]
},
"displayName": {
"type": ["string", "null"]
},
"division": {
"type": ["string", "null"]
},
"email": {
"type": ["string", "null"]
},
"employeeNumber": {
"type": ["string", "null"]
},
"firstName": {
"type": ["string", "null"]
},
"honorificPrefix": {
"type": ["string", "null"]
},
"honorificSuffix": {
"type": ["string", "null"]
},
"lastName": {
"type": ["string", "null"]
},
"locale": {
"type": ["string", "null"]
},
"login": {
"type": ["string", "null"]
},
"manager": {
"type": ["string", "null"]
},
"managerId": {
"type": ["string", "null"]
},
"middleName": {
"type": ["string", "null"]
},
"mobilePhone": {
"type": ["string", "null"]
},
"nickName": {
"type": ["string", "null"]
},
"organization": {
"type": ["string", "null"]
},
"postalAddress": {
"type": ["string", "null"]
},
"preferredLanguage": {
"type": ["string", "null"]
},
"primaryPhone": {
"type": ["string", "null"]
},
"profileUrl": {
"type": ["string", "null"]
},
"secondEmail": {
"type": ["string", "null"]
},
"state": {
"type": ["string", "null"]
},
"streetAddress": {
"type": ["string", "null"]
},
"timezone": {
"type": ["string", "null"]
},
"title": {
"type": ["string", "null"]
},
"userType": {
"type": ["string", "null"]
},
"zipCode": {
"type": ["string", "null"]
}
},
"type": "object"
},
"status": {
"enum": [
"ACTIVE",
"DEPROVISIONED",
"LOCKED_OUT",
"PASSWORD_EXPIRED",
"PROVISIONED",
"RECOVERY",
"STAGED",
"SUSPENDED"
],
"type": "string"
},
"statusChanged": {
"format": "date-time",
"type": ["string", "null"]
},
"type": {
"properties": {
"id": {
"type": ["string", "null"]
}
},
"type": "object"
}
},
"type": "object"
}
Loading

0 comments on commit 8b422c7

Please sign in to comment.