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 custom roles stream #14610

Merged
merged 5 commits into from
Jul 13, 2022
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.5
dockerImageTag: 0.1.6
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.5"
- dockerImage: "airbyte/source-okta:0.1.6"
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.5
LABEL io.airbyte.version=0.1.6
LABEL io.airbyte.name=airbyte/source-okta
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tests:
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: ["logs"]
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["id"],
"primary_key": [["id"]]
},
{
"stream": {
"name": "custom_roles",
"json_schema": {}
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"primary_key": [["id"]]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["id"],
"primary_key": [["id"]]
},
{
"stream": {
"name": "custom_roles",
"json_schema": {},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"created": {
"format": "date-time",
"type": "string"
},
"lastUpdated": {
"format": "date-time",
"type": "string"
},
"_links": {
"properties": {
"assignee": {
"properties": {
"self": {
"$ref": "shared-link.json"
},
"permissions": {
"$ref": "shared-link.json",
"description": "Gets a list of Permissions that is granted through this assignment"
}
}
}
},
"type": ["object", "null"]
}
},
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$id": "shared-link.json",
"properties": {
"herf": {
"format": "uri",
"type": ["string", "null"]
}
},
"type": ["object", "null"]
}
15 changes: 15 additions & 0 deletions airbyte-integrations/connectors/source-okta/source_okta/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ def path(self, **kwargs) -> str:
return "users"


class CustomRoles(OktaStream):
primary_key = "id"

def path(self, **kwargs) -> str:
return "iam/roles"

def parse_response(
self,
response: requests.Response,
**kwargs,
) -> Iterable[Mapping]:
yield from response.json()["roles"]


class SourceOkta(AbstractSource):
def initialize_authenticator(self, config: Mapping[str, Any]) -> TokenAuthenticator:
return TokenAuthenticator(config["token"], auth_method="SSWS")
Expand Down Expand Up @@ -230,4 +244,5 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]:
Logs(**initialization_params),
Users(**initialization_params),
GroupMembers(**initialization_params),
CustomRoles(**initialization_params),
]
2 changes: 2 additions & 0 deletions docs/integrations/sources/okta.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This Source is capable of syncing the following core Streams:
* [Groups](https://developer.okta.com/docs/reference/api/groups/#list-groups)
* [Group Members](https://developer.okta.com/docs/reference/api/groups/#list-group-members)
* [System Log](https://developer.okta.com/docs/reference/api/system-log/#get-started)
* [Custom Roles](https://developer.okta.com/docs/reference/api/roles/#list-roles)

### Data type mapping

Expand Down Expand Up @@ -62,6 +63,7 @@ Different Okta APIs require different admin privilege levels. API tokens inherit

| Version | Date | Pull Request | Subject |
| :--- | :--- | :--- | :--- |
| 0.1.6 | 2022-07-11 | [14610](https://github.com/airbytehq/airbyte/pull/14610) | add custom roles stream |
| 0.1.5 | 2022-07-04 | [14380](https://github.com/airbytehq/airbyte/pull/14380) | add Group_Members stream to okta source |
| 0.1.4 | 2021-11-02 | [7584](https://github.com/airbytehq/airbyte/pull/7584) | Fix incremental params for log stream |
| 0.1.3 | 2021-09-08 | [5905](https://github.com/airbytehq/airbyte/pull/5905) | Fix incremental stream defect |
Expand Down