-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create oAuth client for frontend service (#87)
This is work on #27, just the part that sets up and provides the details to Kubernetes for the oAuth authentication tokens. This PR: * Generates an internal oAuth brand and client token * Provides instructions on how to make it external * Generates a `ConfigMap` with the env data that will need to be passed to the eventual `frontend` Pod container. * Deploy said ConfigMap to the Services cluster. I also rename "frontend-api" to "frontend", since the "api" part seemed redundant. Next should be Cloud Build the image and Deploy it as a `Deployment` and `Service`.
- Loading branch information
1 parent
f4a2373
commit 21f1c7f
Showing
18 changed files
with
102 additions
and
1 deletion.
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
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,26 @@ | ||
# Copyright 2023 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: frontend-service | ||
data: | ||
CLIENT_ID: ${client_id} | ||
CLIENT_SECRET: ${client_secret} | ||
LISTEN_PORT: "8080" | ||
CLIENT_LAUNCHER_PORT: "8082" | ||
PROFILE_SERVICE: http://profile | ||
PING_SERVICE: http://ping-discovery | ||
JWT_KEY: ${jwt_key} |
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 |
---|---|---|
|
@@ -115,3 +115,31 @@ resource "local_file" "services-ping-service-account" { | |
}) | ||
filename = "${path.module}/${var.services_directory}/ping-discovery/service-account.yaml" | ||
} | ||
|
||
# | ||
# OAuth Credentials for the Frontend Service | ||
# | ||
|
||
resource "google_iap_brand" "project_brand" { | ||
support_email = "[email protected]" | ||
application_title = "Global Game Demo" | ||
project = var.project | ||
|
||
depends_on = [google_project_service.project] | ||
} | ||
|
||
resource "google_iap_client" "project_client" { | ||
display_name = "Global Game Client" | ||
brand = google_iap_brand.project_brand.name | ||
} | ||
|
||
# Make the environment configmap for the front service | ||
resource "local_file" "services-frontend-config-map" { | ||
content = templatefile( | ||
"${path.module}/files/services/frontend-configmap.yaml.tpl", { | ||
client_id = google_iap_client.project_client.client_id | ||
client_secret = google_iap_client.project_client.secret | ||
jwt_key = var.frontend-service.jwt_key | ||
}) | ||
filename = "${path.module}/${var.services_directory}/frontend/configmap.yaml" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2023 Google LLC All Rights Reserved. | ||
# | ||
# 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. | ||
|
||
configmap.yaml |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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