GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Registries Proxy: Support feeding a base64 encoded configuration by marcogario · Pull Request #2404 · github/codeql-action

Conversation

@marcogario

@marcogario marcogario commented Aug 2, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Extend the start-proxy action to support passing the configuration as a base64 encoded variable. The reason to do so, is that this information is being passed by Actions as a secret. Actions recommends against passing structured data as a secret because it becomes harder to scrub it. Therefore, we send the information as a simple string.

We introduce the new input registries_credentials in parallel with the previous input to make it easier to test this while we are still building the remaining parts of the system. We will deprecate and remove the old property (registry_secrets) in the future. Note that this entire action is meant to be for internal use only.

Finally, in this PR I also refactored a bit the logic to more clearly distinguish the key steps, perform some validation of the input, and thread the logger for increase observability.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
marcogario added 2 commits July 30, 2024 18:55
@marcogario
Consider registries_credentials as input
dc92ab6
@marcogario
Clean-up logging
3b3012e
github-advanced-security[bot]
github-advanced-security AI found potential problems Aug 2, 2024
View reviewed changes
Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

marcogario added 2 commits August 13, 2024 13:31
@marcogario
More debugging of credentials
e4afb79
@marcogario
Support URL
f736881
@marcogario
marcogario marked this pull request as ready for review August 13, 2024 14:00
@marcogario
marcogario requested a review from a team as a code owner August 13, 2024 14:00
@marcogario
Merge remote-tracking branch 'origin/main' into marcogario/proxy_64
1bd7fdc
aeisenberg
aeisenberg reviewed Aug 13, 2024
View reviewed changes
Comment thread src/start-proxy-action.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy-action.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/start-proxy-action.ts Outdated
function getCredentials(): Credential[] {
const encodedCredentials = actionsUtil.getOptionalInput("registries_credentials");
if (encodedCredentials !== undefined) {
const credentialsStr = Buffer.from(encodedCredentials, "base64").toString();

@aeisenberg aeisenberg Aug 13, 2024

Copy link
Copy Markdown
Contributor

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.

This seems like some extra hoops to go through for the workflow file to send base64 encoded credentials. Does it make more sense to accept non-encoded credentials and only base64 encode them in the action?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@marcogario marcogario Aug 14, 2024

Copy link
Copy Markdown
Contributor Author

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.

Indeed, there are some extra steps, but I think they are justified.

The proxy takes a JSON object as previously defined in registry_secrets. The problem is that Actions recommends not using structured data within secrets:

To help ensure that GitHub redacts your secret in logs, avoid using structured data as the values of secrets.

Therefore, we encode it as a single string to make scrubbing possible.

The underlying reason we need a struct is that (due to the integration with default setup) we need to provide a potentially arbitrary number of credentials, and we cannot easily know which ones/how many beforehand.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread start-proxy/action.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
Validate credentials input
5b34615
github-advanced-security[bot]
github-advanced-security AI found potential problems Aug 15, 2024
View reviewed changes
Comment thread src/start-proxy-action.ts Fixed

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
fixes
7baf392
@marcogario
marcogario force-pushed the marcogario/proxy_64 branch 3 times, most recently from 7156568 to a9c1d1c Compare August 15, 2024 16:34
@marcogario
Try upload teh proxy logs
0b84d89
@marcogario
marcogario force-pushed the marcogario/proxy_64 branch from a9c1d1c to 0b84d89 Compare August 15, 2024 16:40
@marcogario marcogario assigned aibaars Aug 15, 2024
@marcogario

marcogario commented Aug 15, 2024

Copy link
Copy Markdown
Contributor Author

@aeisenberg this is ready for another review. I am also assigning @aibaars so he can shepherd this to completion in case there are issues to address.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcogario
marcogario requested a review from aeisenberg August 15, 2024 16:48
aeisenberg
aeisenberg approved these changes Aug 19, 2024
View reviewed changes

@aeisenberg aeisenberg left a comment

Copy link
Copy Markdown
Contributor

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.

Awesome. Thanks. Looks great.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aibaars
aibaars approved these changes Aug 20, 2024
View reviewed changes
@aibaars
aibaars merged commit 512e306 into main Aug 20, 2024
@aibaars
aibaars deleted the marcogario/proxy_64 branch August 20, 2024 10:10
This was referenced Aug 21, 2024
Merge main into releases/v3 #2437
Merged
Merge releases/v3 into releases/v2 #2439
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aeisenberg aeisenberg aeisenberg approved these changes
+1 more reviewer
@aibaars aibaars aibaars approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@aibaars aibaars

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@marcogario @aeisenberg @aibaars @github-advanced-security
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.