-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add endpoints service IAM #2318
Merged
slevenick
merged 10 commits into
GoogleCloudPlatform:master
from
slevenick:endpoints-service-iam
Feb 13, 2020
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2dcf806
Add endpoints service IAM
slevenick a5870b0
Update dates
slevenick e81d596
Dates again
slevenick 405e831
Rename to servicemanagement product, legacyname to override to fit wi…
slevenick e110d51
Remove duplicate endpoint code, these are generated now
slevenick 8498e65
rename and add to website erb
slevenick c737258
Rename display name
slevenick ee91d33
Legacyname/product name fixes in IAM docs
slevenick 3a7f80b
Use display name in iam docs
slevenick 6b16fba
Extra new lines needed in iam docs
slevenick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2020 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- !ruby/object:Api::Product | ||
name: Endpoints | ||
display_name: Endpoints | ||
versions: | ||
- !ruby/object:Api::Product::Version | ||
name: ga | ||
base_url: https://servicemanagement.googleapis.com/v1/ | ||
scopes: | ||
- https://www.googleapis.com/auth/cloudplatform | ||
apis_required: | ||
- !ruby/object:Api::Product::ApiReference | ||
name: Service Management API | ||
url: https://console.cloud.google.com/apis/library/servicemanagement.googleapis.com/ | ||
objects: | ||
- !ruby/object:Api::Resource | ||
name: 'Service' | ||
base_url: services | ||
self_link: services/{{serviceName}} | ||
description: | | ||
A service that is managed by Google Service Management | ||
properties: | ||
- !ruby/object:Api::Type::String | ||
name: 'serviceName' | ||
description: The name of the service. | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2020 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
--- !ruby/object:Provider::Terraform::Config | ||
overrides: !ruby/object:Overrides::ResourceOverrides | ||
Service: !ruby/object:Overrides::Terraform::ResourceOverride | ||
legacy_name: google_endpoints_service | ||
id_format: 'services/{{serviceName}}' | ||
import_format: ["services/{{serviceName}}"] | ||
exclude_resource: true | ||
iam_policy: !ruby/object:Api::Resource::IamPolicy | ||
parent_resource_attribute: 'service_name' | ||
method_name_separator: ':' | ||
fetch_iam_policy_verb: :POST | ||
exclude: false | ||
examples: | ||
- !ruby/object:Provider::Terraform::Examples | ||
name: "endpoints_iam" | ||
primary_resource_id: "endpoints_service" | ||
primary_resource_name: "fmt.Sprintf(\"endpoint%s.endpoints.%s.cloud.goog\", context[\"random_suffix\"], context[\"project_name\"])" | ||
vars: | ||
name: "endpoint" | ||
test_env_vars: | ||
project_name: :PROJECT_NAME | ||
# This is for copying files over | ||
files: !ruby/object:Provider::Config::Files | ||
# These files have templating (ERB) code that will be run. | ||
# This is usually to add licensing info, autogeneration notices, etc. | ||
compile: | ||
<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "google_endpoints_service" "<%= ctx[:primary_resource_id] %>" { | ||
service_name = "<%= ctx[:vars]["name"] %>.endpoints.<%= ctx[:test_env_vars]["project_name"] %>.cloud.goog" | ||
project = "<%= ctx[:test_env_vars]["project_name"] %>" | ||
grpc_config = <<EOF | ||
type: google.api.Service | ||
config_version: 3 | ||
name: <%= ctx[:vars]["name"] %>.endpoints.<%= ctx[:test_env_vars]["project_name"] %>.cloud.goog | ||
usage: | ||
rules: | ||
- selector: endpoints.examples.bookstore.Bookstore.ListShelves | ||
allow_unregistered_calls: true | ||
EOF | ||
protoc_output_base64 = "${filebase64("test-fixtures/test_api_descriptor.pb")}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I think we do need to leave these in until 4.0.0 so that anyone that was setting the custom endpoint still can
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh gosh, I keep changing the product name to make the docs line up right but the product name also goes in here 🤦♂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by changing the docs to use the product's display name and moving the product that produces this IAM resource to use the same namespace as the existing handwritten one.