Skip to content

Commit

Permalink
chore: exclude api key support (#141)
Browse files Browse the repository at this point in the history
* chore: upgrade gapic-generator-java, gax-java and gapic-generator-python

PiperOrigin-RevId: 423842556

Source-Link: googleapis/googleapis@a616ca0

Source-Link: googleapis/googleapis-gen@29b938c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjliOTM4YzU4YzFlNTFkMDE5ZjJlZTUzOWQ1NWRjMGEzYzg2YTkwNSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add replacements in owlbot.py to exclude get_mtls_endpoint_and_cert_source

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Jan 25, 2022
1 parent e5d5938 commit fe72377
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
Expand Down
37 changes: 31 additions & 6 deletions packages/grafeas/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ def from_service_account_file.*
flags=re.MULTILINE | re.DOTALL,
)

# Remove `get_mtls_endpoint_and_cert_source` method
s.replace(
library / "grafeas/**/client.py",
"""@classmethod
def get_mtls_endpoint_and_cert_source.*?return api_endpoint, client_cert_source""",
"",
flags=re.MULTILINE | re.DOTALL,
)

# Remove `get_mtls_endpoint_and_cert_source` method
s.replace(
library / "grafeas/**/async_client.py",
"""@classmethod
def get_mtls_endpoint_and_cert_source.*?return GrafeasClient.get_mtls_endpoint_and_cert_source\(client_options\) # type: ignore""",
"",
flags=re.MULTILINE | re.DOTALL,
)

# Remove credentials and client options from the service celint
# A transport must be used to initialize the client
s.replace(
Expand Down Expand Up @@ -182,12 +200,19 @@ def test_get_occurrence""",
flags=re.MULTILINE | re.DOTALL,
)

# Work around gapic generator bug https://github.com/googleapis/gapic-generator-python/issues/902
s.replace(library / f"grafeas/grafeas_{library.name}/types/*.py",
r""".
Attributes:""",
r""".\n
Attributes:""",
# remove test api key credentials
s.replace(
library / "tests/**/test_grafeas.py",
"""@pytest.mark.parametrize\("client_class,transport_class", \[
\(GrafeasClient, transports.GrafeasGrpcTransport\),
\(GrafeasAsyncClient, transports.GrafeasGrpcAsyncIOTransport\),
\]\)
def test_api_key_credentials.*?client_info=transports.base.DEFAULT_CLIENT_INFO,
always_use_jwt_access=True,
\)""",
"""""",

flags=re.MULTILINE | re.DOTALL,
)

excludes = ["README.rst", "setup.py", "docs/index.rst"]
Expand Down

0 comments on commit fe72377

Please sign in to comment.