Skip to content

Commit 153ab5f

Browse files
feat(serviceextensions): Add new callout sample for add_header (GoogleCloudPlatform#10766)
* feat(serviceextensions): Add new sample * feat(serviceextensions): Add new sample * Add region tags * clear .pyi file * feat(serviceextensions): code cleanup & update test cases * feat(serviceextensions): Add docker definition file. * feat(serviceextensions): Minor updates 1. Add licence header to Dockerfile 2. Update linter checker to ignore the auto-generated files 3. Update Readme.md * feat(serviceextensions): Update linter checker to ignore _credentials.py file * feat(serviceextensions): fix region tag & update code comments * feat(serviceextensions): fix path * feat(serviceextensions): Removing _credentials.py file & renamed credentials foldername * feat(serviceextensions): Removing _credentials.py file * feat(serviceextensions): Add config to ignore python 2.7 and python versions < 3.7 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(serviceextensions): Add test requirements file * feat(serviceextensions): Testing with IP 127.0.0.1 * feat(serviceextensions): Rollback IP 127.0.0.1 & update health check port * feat(serviceextensions): Reduce the test CICD and update the ssl port * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(serviceextensions): Update config --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8ac4a9a commit 153ab5f

14 files changed

Lines changed: 1276 additions & 0 deletions

File tree

.github/header-checker-lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ignoreFiles:
2525
- "dlp/snippets/resources/harmless.txt"
2626
- "dlp/snippets/resources/test.txt"
2727
- "dlp/snippets/resources/term_list.txt"
28+
- "service_extensions/callouts/add_header/service_pb2.py"
29+
- "service_extensions/callouts/add_header/service_pb2_grpc.py"
2830

2931
ignoreLicenseYear: true
3032

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2023 Google, LLC.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# [START serviceextensions_add_header_docker]
15+
FROM marketplace.gcr.io/google/debian11
16+
WORKDIR /home/callouts
17+
COPY . .
18+
RUN apt-get update && apt-get install -y python3-grpc-tools
19+
EXPOSE 80
20+
EXPOSE 8080
21+
EXPOSE 443
22+
CMD [ "/usr/bin/python3", "server.py" ]
23+
# [END serviceextensions_add_header_docker]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
__Copyrights and Licences__
3+
4+
Files using Copyright 2023 Google LLC & Apache License Version 2.0:
5+
* server.py contains gRPC server code
6+
* test_server.py contains client stub code to test the server.py
7+
8+
Following files are auto-generated by debian grpc-tools
9+
* service_pb2.py
10+
* service_pb2_grpc.py
11+
12+
Proto file `protos/service.proto` is from https://github.com/envoyproxy/envoy/
13+
and uses [Apache License Version 2.0](https://github.com/envoyproxy/envoy/blob/main/LICENSE).
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Default TEST_CONFIG_OVERRIDE for python repos.
16+
17+
# You can copy this file into your directory, then it will be imported from
18+
# the noxfile.py.
19+
20+
# The source of truth:
21+
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/noxfile_config.py
22+
23+
TEST_CONFIG_OVERRIDE = {
24+
# Supported versions are >= 3.7 as per https://pypi.org/project/grpcio/
25+
"ignored_versions": ["2.7", "3.6", "3.7"], # "3.9", "3.8", "3.10", "3.11"
26+
# Old samples are opted out of enforcing Python type hints
27+
# All new samples should feature them
28+
"enforce_type_hints": True,
29+
# An envvar key for determining the project id to use. Change it
30+
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
31+
# build specific Cloud project. You can also use your own string
32+
# to use your own Cloud project.
33+
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
34+
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
35+
# If you need to use a specific version of pip,
36+
# change pip_version_override to the string representation
37+
# of the version number, for example, "20.2.4"
38+
"pip_version_override": "22.0.4",
39+
# A dictionary you want to inject into your test. Don't put any
40+
# secrets here. These values will override predefined values.
41+
"envs": {"GRPC_VERBOSITY": "debug"},
42+
}

0 commit comments

Comments
 (0)