Bulk update deprecated authenticators (#40549)
This commit is contained in:
committed by
GitHub
parent
dc1e0ac01c
commit
ffca542fc9
@@ -7,7 +7,7 @@ import pathlib
|
||||
from base64 import b64encode
|
||||
from typing import Any, List, Mapping
|
||||
|
||||
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
|
||||
from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
|
||||
from streams import (
|
||||
DashboardsGenerator,
|
||||
FiltersGenerator,
|
||||
|
||||
@@ -34,7 +34,7 @@ from source_jira.streams import (
|
||||
|
||||
class GeneratorMixin:
|
||||
def get_generate_headers(self):
|
||||
headers = {"Accept": "application/json", "Content-Type": "application/json", **self.authenticator.get_auth_header()}
|
||||
headers = {"Accept": "application/json", "Content-Type": "application/json", **self._session.auth.get_auth_header()}
|
||||
return headers
|
||||
|
||||
def generate_record(
|
||||
@@ -84,7 +84,7 @@ class FilterSharingGenerator(FilterSharing, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
filters_stream = Filters(authenticator=self.authenticator, domain=self._domain)
|
||||
filters_stream = Filters(authenticator=self._session.auth, domain=self._domain)
|
||||
for filters in filters_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
for index in range(random.randrange(4)):
|
||||
group_name = random.choice(["Test group 0", "Test group 1", "Test group 2"])
|
||||
@@ -142,7 +142,7 @@ class IssueCommentsGenerator(IssueComments, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
issues_stream = Issues(authenticator=self.authenticator, domain=self._domain)
|
||||
issues_stream = Issues(authenticator=self._session.auth, domain=self._domain)
|
||||
for issue in issues_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
for index in range(20):
|
||||
payload = json.dumps(
|
||||
@@ -195,7 +195,7 @@ class IssueRemoteLinksGenerator(IssueRemoteLinks, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
issues_stream = Issues(authenticator=self.authenticator, domain=self._domain)
|
||||
issues_stream = Issues(authenticator=self._session.auth, domain=self._domain)
|
||||
for issue in issues_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
payload = json.dumps(
|
||||
{
|
||||
@@ -227,7 +227,7 @@ class IssueVotesGenerator(IssueVotes, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
issues_stream = Issues(authenticator=self.authenticator, domain=self._domain)
|
||||
issues_stream = Issues(authenticator=self._session.auth, domain=self._domain)
|
||||
for issue in issues_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
payload = None
|
||||
self.generate_record(payload, stream_slice={"key": issue["key"]})
|
||||
@@ -239,7 +239,7 @@ class IssueWatchersGenerator(IssueWatchers, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
issues_stream = Issues(authenticator=self.authenticator, domain=self._domain)
|
||||
issues_stream = Issues(authenticator=self._session.auth, domain=self._domain)
|
||||
for issue in issues_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
payload = None
|
||||
self.generate_record(payload, stream_slice={"key": issue["key"]})
|
||||
@@ -251,7 +251,7 @@ class IssueWorklogsGenerator(IssueWorklogs, GeneratorMixin):
|
||||
"""
|
||||
|
||||
def generate(self):
|
||||
issues_stream = Issues(authenticator=self.authenticator, domain=self._domain)
|
||||
issues_stream = Issues(authenticator=self._session.auth, domain=self._domain)
|
||||
for issue in issues_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
for index in range(random.randrange(1, 6)):
|
||||
payload = json.dumps(
|
||||
@@ -312,7 +312,7 @@ class ProjectComponentsGenerator(ProjectComponents, GeneratorMixin):
|
||||
return "component"
|
||||
|
||||
def generate(self):
|
||||
projects_stream = Projects(authenticator=self.authenticator, domain=self._domain)
|
||||
projects_stream = Projects(authenticator=self._session.auth, domain=self._domain)
|
||||
for project in projects_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
for index in range(random.randrange(6)):
|
||||
payload = json.dumps(
|
||||
@@ -337,7 +337,7 @@ class ProjectVersionsGenerator(ProjectVersions, GeneratorMixin):
|
||||
return "version"
|
||||
|
||||
def generate(self):
|
||||
projects_stream = Projects(authenticator=self.authenticator, domain=self._domain)
|
||||
projects_stream = Projects(authenticator=self._session.auth, domain=self._domain)
|
||||
for project in projects_stream.read_records(sync_mode=SyncMode.full_refresh):
|
||||
for index in range(random.randrange(6)):
|
||||
payload = json.dumps(
|
||||
|
||||
@@ -10,7 +10,7 @@ data:
|
||||
connectorSubtype: api
|
||||
connectorType: source
|
||||
definitionId: 68e63de2-bb83-4c7e-93fa-a8a9051e3993
|
||||
dockerImageTag: 3.0.3
|
||||
dockerImageTag: 3.0.4
|
||||
dockerRepository: airbyte/source-jira
|
||||
documentationUrl: https://docs.airbyte.com/integrations/sources/jira
|
||||
githubIssueLabel: source-jira
|
||||
|
||||
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
version = "3.0.3"
|
||||
version = "3.0.4"
|
||||
name = "source-jira"
|
||||
description = "Source implementation for Jira."
|
||||
authors = [ "Airbyte <contact@airbyte.io>",]
|
||||
|
||||
@@ -223,8 +223,8 @@ class Issues(IncrementalJiraStream):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._project_ids = []
|
||||
self.issue_fields_stream = IssueFields(authenticator=self.authenticator, domain=self._domain, projects=self._projects)
|
||||
self.projects_stream = Projects(authenticator=self.authenticator, domain=self._domain, projects=self._projects)
|
||||
self.issue_fields_stream = IssueFields(authenticator=self._session.auth, domain=self._domain, projects=self._projects)
|
||||
self.projects_stream = Projects(authenticator=self._session.auth, domain=self._domain, projects=self._projects)
|
||||
|
||||
def path(self, **kwargs) -> str:
|
||||
return "search"
|
||||
@@ -340,7 +340,7 @@ class IssueWorklogs(IncrementalJiraStream):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.issues_stream = Issues(
|
||||
authenticator=self.authenticator,
|
||||
authenticator=self._session.auth,
|
||||
domain=self._domain,
|
||||
projects=self._projects,
|
||||
start_date=self._start_date,
|
||||
@@ -370,7 +370,7 @@ class IssueComments(IncrementalJiraStream):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.issues_stream = Issues(
|
||||
authenticator=self.authenticator,
|
||||
authenticator=self._session.auth,
|
||||
domain=self._domain,
|
||||
projects=self._projects,
|
||||
start_date=self._start_date,
|
||||
|
||||
Reference in New Issue
Block a user