-
Notifications
You must be signed in to change notification settings - Fork 9
Enforce CFSClean network isolation in 1ES pipelines #1023
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
Merged
+64
−4
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,21 @@ | ||
| steps: | ||
| - pwsh: | | ||
| $cargoHome = $env:CARGO_HOME | ||
| if (-not $cargoHome) { $cargoHome = ([System.IO.Path]::Combine($HOME, '.cargo')) } | ||
| New-Item -ItemType Directory -Force -Path $cargoHome | Out-Null | ||
|
|
||
| $configPath = ([System.IO.Path]::Combine($cargoHome, 'config.toml')) | ||
| Copy-Item ` | ||
| -Path '$(Build.SourcesDirectory)/eng/templates/config.toml.template' ` | ||
| -Destination $configPath ` | ||
| -Force | ||
|
|
||
| Write-Host "Wrote cargo config to $configPath" | ||
| Get-Content $configPath | ||
| Write-Host "##vso[task.setvariable variable=CargoConfigPath]$configPath" | ||
| displayName: Configure cargo to use the azure-sdk-for-rust feed | ||
|
|
||
| - task: CargoAuthenticate@0 | ||
| displayName: Authenticate cargo to the azure-sdk-for-rust feed | ||
| inputs: | ||
| configFile: $(CargoConfigPath) |
This file contains hidden or 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 hidden or 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,37 @@ | ||
| # Cargo configuration used by CI builds to route crates.io traffic through the | ||
| # Centralized Feed Service (CFS) instead of the public internet. | ||
| # | ||
| # This file should be copied to $CARGO_HOME/config.toml | ||
| # | ||
| # CargoAuthenticate@0 parses the [registries] table below and exports the | ||
| # CARGO_REGISTRIES_AZURE_SDK_FOR_RUST_TOKEN / _CREDENTIAL_PROVIDER variables that cargo | ||
| # needs to authenticate against the feed. The feed sets "auth-required": true, so the | ||
| # token is required even for reads. | ||
| # | ||
| # The [source] replacement redirects index.crates.io and static.crates.io to the | ||
| # feed. | ||
| # | ||
| [registries] | ||
| azure-sdk-for-rust = { index = "sparse+https://pkgs.dev.azure.com/azure-sdk/_packaging/azure-sdk-for-rust/Cargo/index/" } | ||
|
|
||
| [source.crates-io] | ||
| replace-with = "azure-sdk-for-rust" | ||
|
|
||
| # Both `cargo package` and `cargo publish` refuse to run while crates-io is replaced | ||
| # unless the target registry is named, failing with: | ||
| # | ||
| # error: crates-io is replaced with remote registry azure-sdk-for-rust; | ||
| # include `--registry azure-sdk-for-rust` or `--registry crates-io` | ||
| # | ||
| # The target registry must be the replacement, not crates-io. When packaging several | ||
| # workspace members at once, cargo satisfies their unpublished inter-member versions | ||
| # (for example typespec_client_core depending on typespec ^1.2.0-beta.1) from the crates | ||
| # it just packaged. That overlay is only consulted when the target registry matches the | ||
| # source deps resolve through, so `--registry crates-io` still fails to find them. | ||
| # | ||
| # Setting the default here keeps eng/scripts/Pack-Crates.ps1 free of CI-only flags, so | ||
| # it behaves identically for local developers. Nothing publishes for real from cargo: | ||
| # the only `cargo publish` in the repo is Pack-Crates.ps1's `--dry-run` validation, and | ||
| # releases ship through ESRP. | ||
| [registry] | ||
| default = "azure-sdk-for-rust" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.