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

πŸŽ‰ Source Okta: add GroupMembers stream #14380

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -5906,7 +5906,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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to highlight here for the connectors platform team. I am new to python, I learned that null is None in python. In fact, null is not recommended in the enum array. If I don't add this line, the acceptance test will throw an error because the value is null in one of the logs.

Though the value type is ["string", "null"], it doesn't accept null or None 🀷 . Specifically, the method from python-jsonschema throws an error:

https://github.com/python-jsonschema/jsonschema/blob/main/jsonschema/_validators.py#L279-L285

ERROR    root:test_core.py:299 
The logs stream has the following schema errors:
None is not one of ['OKTA_AUTHENTICATION_PROVIDER', 'ACTIVE_DIRECTORY', 'LDAP', 'FEDERATION', 'SOCIAL', 'FACTOR_PROVIDER']

Failed validating 'enum' in schema['properties']['authenticationContext']['properties']['authenticationProvider']:
    {'enum': ['OKTA_AUTHENTICATION_PROVIDER',
              'ACTIVE_DIRECTORY',
              'LDAP',
              'FEDERATION',
              'SOCIAL',
              'FACTOR_PROVIDER'],
     'type': ['string', 'null']}

I am pretty sure the acceptance test is not 100% at the current master branch. I want to achieve it, so I apply this duck tape.

],
"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