Skip to content

Conversation

@matt-FFFFFF
Copy link
Member

@matt-FFFFFF matt-FFFFFF commented Sep 3, 2025

Fixes Azure/Azure-Landing-Zones#1492

This pull request introduces a new internal authentication helper package, refactors all authentication logic to use this new helper, and adds tests and documentation for it. Additionally, it updates the Go version, modifies CI to support 32-bit builds, and adjusts build targets.

Authentication Refactor and Improvements

  • Introduced a new internal package internal/auth with a helper function NewToken() to create Azure credentials using well-known Azure/Terraform environment variables and conventions. This centralizes and simplifies authentication logic for the entire codebase. [1] [2]
  • Replaced all direct usage of azidentity.NewDefaultAzureCredential with the new auth.NewToken() helper throughout the codebase and tests, ensuring consistent and maintainable authentication handling. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Testing and Documentation

  • Added a comprehensive test suite for the new authentication helper (internal/auth/auth_test.go) to ensure correct environment variable parsing and logic.
  • Added package documentation (internal/auth/doc.go) explaining usage, supported environment variables, and behavior of the new authentication helper.

Build and CI Enhancements

  • Updated the Go version in go.mod to 1.25.0 and added a dependency on github.com/Azure/entrauth.
  • Added a 32-bit Linux build job to CI (.github/workflows/go-test.yml) and excluded unsupported build targets in .goreleaser.yml. [1] [2]

Imports and Code Cleanup

  • Updated import statements across the codebase to use the new internal/auth package instead of importing azidentity directly. [1] [2] [3] [4] [5] [6]

These changes collectively improve maintainability, testability, and CI support for the project.

dependabot bot and others added 6 commits August 28, 2025 19:42
Bumps the go_modules group with 1 update in the / directory: [github.com/ulikunitz/xz](https://github.com/ulikunitz/xz).


Updates `github.com/ulikunitz/xz` from 0.5.12 to 0.5.14
- [Commits](ulikunitz/xz@v0.5.12...v0.5.14)

---
updated-dependencies:
- dependency-name: github.com/ulikunitz/xz
  dependency-version: 0.5.14
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 23.37662% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.07%. Comparing base (bf9ce45) to head (fed9978).

Files with missing lines Patch % Lines
internal/auth/auth.go 22.66% 58 Missing ⚠️
cmd/alzlibtool/command/check/library.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     Azure/alzlib#219      +/-   ##
==========================================
- Coverage   45.46%   45.07%   -0.39%     
==========================================
  Files          48       49       +1     
  Lines        4342     4417      +75     
==========================================
+ Hits         1974     1991      +17     
- Misses       2129     2187      +58     
  Partials      239      239              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matt-FFFFFF matt-FFFFFF added this pull request to the merge queue Sep 3, 2025
Merged via the queue into main with commit 1b53a6e Sep 3, 2025
8 checks passed
@matt-FFFFFF matt-FFFFFF deleted the matt-FFFFFF/issue216 branch September 3, 2025 17:21
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.

alzlibtool not respecting Azure US Government Policy Lookups

4 participants