Skip to content
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

Require authentication when a user runs bundle init #2040

Closed
wants to merge 2 commits into from

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Dec 20, 2024

Changes

This will allow us to collect authenticated telemetry on bundle init

Tests

Manually.

Existing templates like default-python are successfully created.

When invalid credentials are present, bundle init exists early (before prompting):

go-playground-easy cli bundle init -p invalid
Error: could not fetch information about the current user: Invalid access token. [TraceId: 00-4ef3cd42fe0a88a2476674e8b38ddc74-1889b28d6c55778f-01]

Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 2040
  • Commit SHA: 78d4940159d240ba57559266df1ba89595eb1ab7

Checks will be approved automatically on success.

@@ -152,20 +138,13 @@ func loadHelpers(ctx context.Context) template.FuncMap {
}
return *cachedCatalog, nil
},
"is_service_principal": func() (bool, error) {
"is_service_principal": func() bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Go text templates use the error returned in the second value as purely a signal to terminate materializing the template. The second value is not something that a user template can access and, thus, should be safe to remove from the type signature here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shreyas-goenka shreyas-goenka changed the title Require authentication when a user runs bundle init Require authentication when a user runs bundle init Dec 20, 2024
@pietern pietern deleted the require-bundle-init-auth branch December 27, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant