Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add cdn signed url sample#4011

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
zabdalimov wants to merge8 commits intoGoogleCloudPlatform:main
base:main
Choose a base branch
Loading
fromzabdalimov:main

Conversation

@zabdalimov
Copy link

Description

Fixes#2437

I'm not associated with Google, but there was an existing issue that covers what I'm trying to achieve, so I didn't create a new one.

Checklist

  • I have followed guidelines fromCONTRIBUTING.MD andSamples Style Guide
  • Tests pass:npm test (seeTesting)
  • Lint pass:npm run lint (seeStyle)
  • These samples need a newAPI enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updatedenv vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off ofGoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated theCODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I createdGitHub Actions workflow for this sample
  • This sample adds a newProduct API, and I updated theBlunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Pleasemerge this PR for me once it is approved

@zabdalimovzabdalimov requested review froma team ascode ownersMarch 4, 2025 19:25
@google-cla
Copy link

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View thisfailed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@snippet-bot
Copy link

snippet-botbot commentedMar 4, 2025
edited
Loading

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated bysnippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, addsnippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-labelproduct-auto-labelbot added samplesIssues that are directly related to samples. api: workflowsIssues related to the Workflows API. labelsMar 4, 2025
Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hello@zabdalimov, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds a new sample for generating signed URLs for Google Cloud CDN. It includes the core signing logic insignurl.js, a test case for the signing function insignurl.test.js, apackage.json file to manage dependencies and testing, and a GitHub Actions workflow file (cdn-signed-urls.yaml) to automate testing. The workflow is also added to the list of workflows in.github/workflows/utils/workflows.json.

Highlights

  • New Functionality: Introduces asignUrl function to generate signed URLs for Google Cloud CDN, enhancing security for CDN resources.
  • Testing: Includes a test case (signurl.test.js) to ensure thesignUrl function generates correct signed URLs with the expected parameters.
  • Automation: Adds a GitHub Actions workflow (cdn-signed-urls.yaml) to automate testing of the CDN signed URLs sample.

Changelog

Click here to see the changelog
  • .github/workflows/cdn-signed-urls.yaml
    • Created a new workflow file to automate testing for the CDN signed URLs sample.
    • Configured the workflow to run on pushes to the main branch and pull requests targeting thecdn/signed-urls directory.
    • Added jobs for testing and flaky bot analysis.
  • .github/workflows/utils/workflows.json
    • Addedcdn/signed-urls to the list of workflows to be tested.
  • cdn/signed-urls/package.json
    • Created apackage.json file to manage dependencies (mocha) and define test scripts.
    • Specified the node engine version as >=16.0.0.
  • cdn/signed-urls/signurl.js
    • Implemented thesignUrl function to generate signed URLs for Google Cloud CDN.
    • The function takes the URL, key name, key value, and expiration date as input.
    • It uses the crypto module to generate the signature.
  • cdn/signed-urls/test/signurl.test.js
    • Created a test file for thesignUrl function.
    • The test case verifies that the generated URL contains the correct parameters (KeyName, Expires, Signature).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in issue comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.


Trivia time!

What does CDN stand for?

Click here for the answer
Content Delivery Network

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Code Review

The pull request introduces a new sample for generating signed URLs for Google Cloud CDN. The code includes a function to sign URLs, a test case, and necessary configurations. Overall, the code is well-structured and easy to understand.

Merge Readiness

The code appears to be in good shape for merging. The functionality is well-tested, and the code is clear and concise. I am unable to directly approve the pull request, and recommend that others review and approve this code before merging.

@glasntglasnt requested a review froma teamMarch 5, 2025 03:37
@glasntglasnt assignedglasnt and unassignedglasntMar 5, 2025
Copy link
Contributor

@glasntglasnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for your first contribution to this repo! You've correctly identified this missing sample (https://cloud.google.com/cdn/docs/using-signed-urls#programmatically_create_signed_urls doesn't have a NodeJS option).

There's a few things that need to be updated for this PR to be accepted, which I'll update for you.

@@ -0,0 +1,52 @@
# Copyright 2023 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This file is no longer required (will update)

@glasntglasnt requested a review fromiennaeAugust 8, 2025 04:47
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@glasntglasntglasnt left review comments

@iennaeiennaeAwaiting requested review from iennae

+1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

@iennaeiennae

Labels

api: workflowsIssues related to the Workflows API.samplesIssues that are directly related to samples.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support creating signed urls for Cloud CDN

3 participants

@zabdalimov@glasnt@iennae

[8]ページ先頭

©2009-2025 Movatter.jp