Merge remote-tracking branch 'origin/main' into onboarding
.github/workflows/build.yml+2
@@ -7,3 +7,5 @@ jobs:
8 go-version: ""
8 go-version: ""
9 go-version-file: ./go.mod
9 go-version-file: ./go.mod
11+ gh_pat: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
@@ -6,7 +6,7 @@ linters:
6 # - goconst
6 # - goconst
9− - gomoddirectives
9+ # - gomoddirectives
10 - goprintffuncname
10 - goprintffuncname
12 - misspell
12 - misspell
@@ -12,10 +12,12 @@ Crush is a tool for building software with AI.
13## Installation
13## Installation
15−* [Packages](https://github.com/charmbracelet/crush/releases/tag/nightly) are available in Debian and RPM formats
15+Nightly builds are available while Crush is in development.
16−* [Binaries](https://github.com/charmbracelet/crush/releases/tag/nightly) are available for Linux and macOS
17+- [Packages](https://github.com/charmbracelet/crush/releases/tag/nightly) are available in Debian and RPM formats
18+- [Binaries](https://github.com/charmbracelet/crush/releases/tag/nightly) are available for Linux and macOS
18−Or just install it with go:
20+You can also just install it with go:
21git clone git@github.com:charmbracelet/crush.git
23git clone git@github.com:charmbracelet/crush.git
@@ -23,6 +25,8 @@ cd crush
28+Note that Crush doesn't support Windows yet, however Windows support is planned and in progress.
26## Getting Started
30## Getting Started
28For now, the quickest way to get started is to set an environment variable for
32For now, the quickest way to get started is to set an environment variable for
@@ -45,13 +49,77 @@ providers.
45| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
49| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
46| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
50| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
54+For many use cases, Crush can be run with no config. That said, if you do need config, it can be added either local to the project itself, or globally. Configuration has the following priority:
58+3. `$HOME/.config/crush/crush.json`
62+Crush can use LSPs for additional context to help inform its decisions, just like you would. LSPs can be added manually like so:
71+ "command": "typescript-language-server",
75+ "command": "alejandra"
81+### OpenAI-Compatible APIs
83+Crush supports all OpenAI-compatible APIs. Here's an example configuration for Deepseek, which uses an OpenAI-compatible API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
89+ "provider_type": "openai",
90+ "base_url": "https://api.deepseek.com/v1",
93+ "id": "deepseek-chat",
94+ "model": "Deepseek V3",
95+ "cost_per_1m_in": 0.27,
96+ "cost_per_1m_out": 1.1,
97+ "cost_per_1m_in_cached": 0.07,
98+ "cost_per_1m_out_cached": 1.1,
99+ "context_window": 64000,
100+ "default_max_tokens": 5000
110+We’d love to hear your thoughts on this project. Feel free to drop us a note!
112+- [Twitter](https://twitter.com/charmcli)
113+- [The Fediverse](https://mastodon.social/@charmcli)
114+- [Discord](https://charm.sh/chat)
48## License
116## License
50[MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE)
118[MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE)
54−Part of [Charm](https://charm.sh).
122+Part of [Charm](https://charm.land).
56<a href="https://charm.sh/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
124<a href="https://charm.sh/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
@@ -2,6 +2,10 @@ module github.com/charmbracelet/crush
5+replace github.com/charmbracelet/bubbletea/v2 => github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250708152737-144080f3d891
7+replace github.com/charmbracelet/lipgloss/v2 => github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250708152830-0fa4ef151093
6 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
10 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0
7 github.com/JohannesKaufmann/html-to-markdown v1.6.0
11 github.com/JohannesKaufmann/html-to-markdown v1.6.0
@@ -13,12 +17,12 @@ require (
13 github.com/bmatcuk/doublestar/v4 v4.8.1
17 github.com/bmatcuk/doublestar/v4 v4.8.1
14 github.com/charlievieth/fastwalk v1.0.11
18 github.com/charlievieth/fastwalk v1.0.11
15 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e
19 github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e
16− github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.3.0.20250609143341-c76fa36f1b94
20+ github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.1
17 github.com/charmbracelet/fang v0.1.0
21 github.com/charmbracelet/fang v0.1.0
18 github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe
22 github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe
19 github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2.0.20250703152125-8e1c474f8a71
23 github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2.0.20250703152125-8e1c474f8a71
20 github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706
24 github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706
21− github.com/charmbracelet/x/ansi v0.9.3-0.20250602153603-fb931ed90413
25+ github.com/charmbracelet/x/ansi v0.9.3
22 github.com/charmbracelet/x/exp/charmtone v0.0.0-20250627134340-c144409e381c
26 github.com/charmbracelet/x/exp/charmtone v0.0.0-20250627134340-c144409e381c
23 github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a
27 github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a
24 github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec
28 github.com/disintegration/imageorient v0.0.0-20180920195336-8147d86e83ec
@@ -71,10 +75,11 @@ require (
71 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
75 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
72 github.com/aymerick/douceur v0.2.0 // indirect
76 github.com/aymerick/douceur v0.2.0 // indirect
73 github.com/charmbracelet/colorprofile v0.3.1 // indirect
77 github.com/charmbracelet/colorprofile v0.3.1 // indirect
78+ github.com/charmbracelet/ultraviolet v0.0.0-20250708152637-0fe0235c8db9 // indirect
74 github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa // indirect
79 github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa // indirect
75 github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef
80 github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef
76− github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86 // indirect
77 github.com/charmbracelet/x/term v0.2.1
81 github.com/charmbracelet/x/term v0.2.1
82+ github.com/charmbracelet/x/termios v0.1.1 // indirect
78 github.com/charmbracelet/x/windows v0.2.1 // indirect
83 github.com/charmbracelet/x/windows v0.2.1 // indirect
79 github.com/davecgh/go-spew v1.1.1 // indirect
84 github.com/davecgh/go-spew v1.1.1 // indirect
80 github.com/disintegration/gift v1.1.2 // indirect
85 github.com/disintegration/gift v1.1.2 // indirect
@@ -128,8 +133,8 @@ require (
128 golang.org/x/crypto v0.37.0 // indirect
133 golang.org/x/crypto v0.37.0 // indirect
129 golang.org/x/image v0.26.0 // indirect
134 golang.org/x/image v0.26.0 // indirect
130 golang.org/x/net v0.39.0 // indirect
135 golang.org/x/net v0.39.0 // indirect
131− golang.org/x/sync v0.13.0 // indirect
136+ golang.org/x/sync v0.15.0 // indirect
132− golang.org/x/sys v0.32.0 // indirect
137+ golang.org/x/sys v0.33.0 // indirect
133 golang.org/x/term v0.31.0 // indirect
138 golang.org/x/term v0.31.0 // indirect
134 golang.org/x/text v0.24.0 // indirect
139 golang.org/x/text v0.24.0 // indirect
135 google.golang.org/genai v1.3.0
140 google.golang.org/genai v1.3.0
@@ -70,20 +70,22 @@ github.com/charlievieth/fastwalk v1.0.11 h1:5sLT/q9+d9xMdpKExawLppqvXFZCVKf6JHnr
70github.com/charlievieth/fastwalk v1.0.11/go.mod h1:yGy1zbxog41ZVMcKA/i8ojXLFsuayX5VvwhQVoj9PBI=
70github.com/charlievieth/fastwalk v1.0.11/go.mod h1:yGy1zbxog41ZVMcKA/i8ojXLFsuayX5VvwhQVoj9PBI=
71github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e h1:99Ugtt633rqauFsXjZobZmtkNpeaWialfj8dl6COC6A=
71github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e h1:99Ugtt633rqauFsXjZobZmtkNpeaWialfj8dl6COC6A=
72github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e/go.mod h1:6HamsBKWqEC/FVHuQMHgQL+knPyvHH55HwJDHl/adMw=
72github.com/charmbracelet/bubbles/v2 v2.0.0-beta.1.0.20250607113720-eb5e1cf3b09e/go.mod h1:6HamsBKWqEC/FVHuQMHgQL+knPyvHH55HwJDHl/adMw=
73−github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.3.0.20250609143341-c76fa36f1b94 h1:QIi50k+uNTJmp2sMs+33D1m/EWr/7OPTJ8x92AY3eOc=
73+github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250708152737-144080f3d891 h1:wh6N1dR4XkDh6XsiZh1/tImJAZvYB0yVLmaUKvJXvK0=
74−github.com/charmbracelet/bubbletea/v2 v2.0.0-beta.3.0.20250609143341-c76fa36f1b94/go.mod h1:oOn1YZGZyJHxJfh4sFAna9vDzxJRNuErLETr/lnlB/I=
74+github.com/charmbracelet/bubbletea-internal/v2 v2.0.0-20250708152737-144080f3d891/go.mod h1:SwBB+WoaQVMMOM9hknbN/7FNT86kgKG0LSHGTmLphX8=
75github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
75github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
76github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
76github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
77github.com/charmbracelet/fang v0.1.0 h1:SlZS2crf3/zQh7Mr4+W+7QR1k+L08rrPX5rm5z3d7Wg=
77github.com/charmbracelet/fang v0.1.0 h1:SlZS2crf3/zQh7Mr4+W+7QR1k+L08rrPX5rm5z3d7Wg=
78github.com/charmbracelet/fang v0.1.0/go.mod h1:Zl/zeUQ8EtQuGyiV0ZKZlZPDowKRTzu8s/367EpN/fc=
78github.com/charmbracelet/fang v0.1.0/go.mod h1:Zl/zeUQ8EtQuGyiV0ZKZlZPDowKRTzu8s/367EpN/fc=
79github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe h1:i6ce4CcAlPpTj2ER69m1DBeLZ3RRcHnKExuwhKa3GfY=
79github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe h1:i6ce4CcAlPpTj2ER69m1DBeLZ3RRcHnKExuwhKa3GfY=
80github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe/go.mod h1:p3Q+aN4eQKeM5jhrmXPMgPrlKbmc59rWSnMsSA3udhk=
80github.com/charmbracelet/glamour/v2 v2.0.0-20250516160903-6f1e2c8f9ebe/go.mod h1:p3Q+aN4eQKeM5jhrmXPMgPrlKbmc59rWSnMsSA3udhk=
81−github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2.0.20250703152125-8e1c474f8a71 h1:X0tsNa2UHCKNw+illiavosasVzqioRo32SRV35iwr2I=
81+github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250708152830-0fa4ef151093 h1:c9vOmNJQUwy/lp/pNOB5ZDMhOuXJ3Y2LL9uZMYGgJxQ=
82−github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.2.0.20250703152125-8e1c474f8a71/go.mod h1:EJWvaCrhOhNGVZMvcjc0yVryl4qqpMs8tz0r9WyEkdQ=
82+github.com/charmbracelet/lipgloss-internal/v2 v2.0.0-20250708152830-0fa4ef151093/go.mod h1:XmxjFJcMEfYIHa4Mw4ra+uMjploDkTlkKIs7wLt9v4Q=
83github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706 h1:WkwO6Ks3mSIGnGuSdKl9qDSyfbYK50z2wc2gGMggegE=
83github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706 h1:WkwO6Ks3mSIGnGuSdKl9qDSyfbYK50z2wc2gGMggegE=
84github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706/go.mod h1:mjJGp00cxcfvD5xdCa+bso251Jt4owrQvuimJtVmEmM=
84github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706/go.mod h1:mjJGp00cxcfvD5xdCa+bso251Jt4owrQvuimJtVmEmM=
85−github.com/charmbracelet/x/ansi v0.9.3-0.20250602153603-fb931ed90413 h1:L07QkDqRF274IZ2UJ/mCTL8DR95efU9BNWLYCDXEjvQ=
85+github.com/charmbracelet/ultraviolet v0.0.0-20250708152637-0fe0235c8db9 h1:+LLFCLxtb/sHegwY3zYdFAbaOgI/I9pv/pxdUlI1Q9s=
86+github.com/charmbracelet/ultraviolet v0.0.0-20250708152637-0fe0235c8db9/go.mod h1:/O+B00+dYG6lqRAWIaNxSvywnDrIH6dmLYQAsH0LRTg=
87+github.com/charmbracelet/x/ansi v0.9.3 h1:BXt5DHS/MKF+LjuK4huWrC6NCvHtexww7dMayh6GXd0=
86−github.com/charmbracelet/x/ansi v0.9.3-0.20250602153603-fb931ed90413/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
88+github.com/charmbracelet/x/ansi v0.9.3/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
87github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa h1:lphz0Z3rsiOtMYiz8axkT24i9yFiueDhJbzyNUADmME=
89github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa h1:lphz0Z3rsiOtMYiz8axkT24i9yFiueDhJbzyNUADmME=
88github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa/go.mod h1:xBlh2Yi3DL3zy/2n15kITpg0YZardf/aa/hgUaIM6Rk=
90github.com/charmbracelet/x/cellbuf v0.0.14-0.20250516160309-24eee56f89fa/go.mod h1:xBlh2Yi3DL3zy/2n15kITpg0YZardf/aa/hgUaIM6Rk=
89github.com/charmbracelet/x/exp/charmtone v0.0.0-20250627134340-c144409e381c h1:2GELBLPgfSbHU53bsQhR9XIgNuVZ6w+Rz8RWV5Lq+A4=
91github.com/charmbracelet/x/exp/charmtone v0.0.0-20250627134340-c144409e381c h1:2GELBLPgfSbHU53bsQhR9XIgNuVZ6w+Rz8RWV5Lq+A4=
@@ -92,10 +94,10 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a h1:FsHE
92github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
94github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
93github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef h1:v7qwsZ2OxzlwvpKwz8dtZXp7fIJlcDEUOyFBNE4fz4Q=
95github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef h1:v7qwsZ2OxzlwvpKwz8dtZXp7fIJlcDEUOyFBNE4fz4Q=
94github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef/go.mod h1:vI5nDVMWi6veaYH+0Fmvpbe/+cv/iJfMntdh+N0+Tms=
96github.com/charmbracelet/x/exp/slice v0.0.0-20250611152503-f53cdd7e01ef/go.mod h1:vI5nDVMWi6veaYH+0Fmvpbe/+cv/iJfMntdh+N0+Tms=
95−github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86 h1:BxAEmOBIDajkgao3EsbBxKQCYvgYPGdT62WASLvtf4Y=
96−github.com/charmbracelet/x/input v0.3.5-0.20250509021451-13796e822d86/go.mod h1:62Rp/6EtTxoeJDSdtpA3tJp3y3ZRpsiekBSje+K8htA=
97github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
97github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
98github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
98github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
99+github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
100+github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
99github.com/charmbracelet/x/windows v0.2.1 h1:3x7vnbpQrjpuq/4L+I4gNsG5htYoCiA5oe9hLjAij5I=
101github.com/charmbracelet/x/windows v0.2.1 h1:3x7vnbpQrjpuq/4L+I4gNsG5htYoCiA5oe9hLjAij5I=
100github.com/charmbracelet/x/windows v0.2.1/go.mod h1:ptZp16h40gDYqs5TSawSVW+yiLB13j4kSMA0lSCHL0M=
102github.com/charmbracelet/x/windows v0.2.1/go.mod h1:ptZp16h40gDYqs5TSawSVW+yiLB13j4kSMA0lSCHL0M=
101github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
103github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -307,8 +309,8 @@ golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
307golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
309golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
308golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
310golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
309golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
311golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
310−golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
312+golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
311−golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
313+golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
312golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
314golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
313golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
315golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
314golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
316golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -323,8 +325,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
323golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
325golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
324golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
326golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
325golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
327golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
326−golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
328+golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
327−golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
329+golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
328golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
330golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
329golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
331golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
330golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
332golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
internal/config/config.go+6−5
@@ -90,11 +90,12 @@ const (
92type MCPConfig struct {
92type MCPConfig struct {
93− Command string `json:"command,omitempty" `
93+ Command string `json:"command,omitempty" `
94− Env []string `json:"env,omitempty"`
94+ Env []string `json:"env,omitempty"`
95− Args []string `json:"args,omitempty"`
95+ Args []string `json:"args,omitempty"`
96− Type MCPType `json:"type"`
96+ Type MCPType `json:"type"`
97− URL string `json:"url,omitempty"`
97+ URL string `json:"url,omitempty"`
98+ Disabled bool `json:"disabled,omitempty"`
99 // TODO: maybe make it possible to get the value from the env
100 // TODO: maybe make it possible to get the value from the env
100 Headers map[string]string `json:"headers,omitempty"`
101 Headers map[string]string `json:"headers,omitempty"`
internal/config/load.go+8−6
@@ -54,16 +54,12 @@ func Load(workingDir string, debug bool) (*Config, error) {
54 cfg.Options.Debug = true
54 cfg.Options.Debug = true
57− // Init logs
57+ // Setup logs
58− log.Init(
58+ log.Setup(
59 filepath.Join(cfg.Options.DataDirectory, "logs", fmt.Sprintf("%s.log", appName)),
59 filepath.Join(cfg.Options.DataDirectory, "logs", fmt.Sprintf("%s.log", appName)),
60 cfg.Options.Debug,
60 cfg.Options.Debug,
64− return nil, fmt.Errorf("failed to load config: %w", err)
67 // Load known providers, this loads the config from fur
63 // Load known providers, this loads the config from fur
68 providers, err := LoadProviders(client.New())
64 providers, err := LoadProviders(client.New())
69 if err != nil || len(providers) == 0 {
65 if err != nil || len(providers) == 0 {
@@ -147,6 +143,9 @@ func (cfg *Config) configureProviders(env env.Env, resolver VariableResolver, kn
149 seen[model.ID] = true
145 seen[model.ID] = true
146+ if model.Model == "" {
147+ model.Model = model.ID
150 models = append(models, model)
149 models = append(models, model)
152 for _, model := range p.Models {
151 for _, model := range p.Models {
@@ -154,6 +153,9 @@ func (cfg *Config) configureProviders(env env.Env, resolver VariableResolver, kn
156 seen[model.ID] = true
155 seen[model.ID] = true
156+ if model.Model == "" {
157+ model.Model = model.ID
157 models = append(models, model)
159 models = append(models, model)
internal/config/load_test.go+5−4
@@ -4,6 +4,7 @@ import (
@@ -45,7 +46,7 @@ func TestConfig_setDefaults(t *testing.T) {
45 assert.NotNil(t, cfg.Models)
46 assert.NotNil(t, cfg.Models)
46 assert.NotNil(t, cfg.LSP)
47 assert.NotNil(t, cfg.LSP)
47 assert.NotNil(t, cfg.MCP)
48 assert.NotNil(t, cfg.MCP)
48− assert.Equal(t, "/tmp/.crush", cfg.Options.DataDirectory)
49+ assert.Equal(t, filepath.Join("/tmp", ".crush"), cfg.Options.DataDirectory)
49 for _, path := range defaultContextPaths {
50 for _, path := range defaultContextPaths {
50 assert.Contains(t, cfg.Options.ContextPaths, path)
51 assert.Contains(t, cfg.Options.ContextPaths, path)
@@ -97,8 +98,8 @@ func TestConfig_configureProvidersWithOverride(t *testing.T) {
97 BaseURL: "https://api.openai.com/v2",
98 BaseURL: "https://api.openai.com/v2",
98 Models: []provider.Model{
99 Models: []provider.Model{
100− ID: "test-model",
101+ ID: "test-model",
101− Name: "Updated",
102+ Model: "Updated",
104 ID: "another-model",
105 ID: "another-model",
@@ -121,7 +122,7 @@ func TestConfig_configureProvidersWithOverride(t *testing.T) {
121 assert.Equal(t, "xyz", cfg.Providers["openai"].APIKey)
122 assert.Equal(t, "xyz", cfg.Providers["openai"].APIKey)
122 assert.Equal(t, "https://api.openai.com/v2", cfg.Providers["openai"].BaseURL)
123 assert.Equal(t, "https://api.openai.com/v2", cfg.Providers["openai"].BaseURL)
123 assert.Len(t, cfg.Providers["openai"].Models, 2)
124 assert.Len(t, cfg.Providers["openai"].Models, 2)
124− assert.Equal(t, "Updated", cfg.Providers["openai"].Models[0].Name)
125+ assert.Equal(t, "Updated", cfg.Providers["openai"].Models[0].Model)
127func TestConfig_configureProvidersWithNewProvider(t *testing.T) {
128func TestConfig_configureProvidersWithNewProvider(t *testing.T) {
internal/fsext/fileutil.go+7−2
@@ -12,6 +12,7 @@ import (
13 "github.com/bmatcuk/doublestar/v4"
13 "github.com/bmatcuk/doublestar/v4"
14 "github.com/charlievieth/fastwalk"
14 "github.com/charlievieth/fastwalk"
15+ "github.com/charmbracelet/crush/internal/log"
16 ignore "github.com/sabhiram/go-gitignore"
17 ignore "github.com/sabhiram/go-gitignore"
@@ -25,11 +26,15 @@ func init() {
25 var err error
26 var err error
26 rgPath, err = exec.LookPath("rg")
27 rgPath, err = exec.LookPath("rg")
27 if err != nil {
28 if err != nil {
29+ if log.Initialized() {
28− slog.Warn("Ripgrep (rg) not found in $PATH. Some features might be limited or slower.")
30+ slog.Warn("Ripgrep (rg) not found in $PATH. Some features might be limited or slower.")
30 fzfPath, err = exec.LookPath("fzf")
33 fzfPath, err = exec.LookPath("fzf")
31 if err != nil {
34 if err != nil {
35+ if log.Initialized() {
32− slog.Warn("FZF not found in $PATH. Some features might be limited or slower.")
36+ slog.Warn("FZF not found in $PATH. Some features might be limited or slower.")
internal/fur/provider/provider.go+1−1
@@ -45,7 +45,7 @@ type Provider struct {
45// Model represents an AI model configuration.
45// Model represents an AI model configuration.
46type Model struct {
46type Model struct {
47 ID string `json:"id"`
47 ID string `json:"id"`
48− Name string `json:"model"`
48+ Model string `json:"model"`
49 CostPer1MIn float64 `json:"cost_per_1m_in"`
49 CostPer1MIn float64 `json:"cost_per_1m_in"`
50 CostPer1MOut float64 `json:"cost_per_1m_out"`
50 CostPer1MOut float64 `json:"cost_per_1m_out"`
51 CostPer1MInCached float64 `json:"cost_per_1m_in_cached"`
51 CostPer1MInCached float64 `json:"cost_per_1m_in_cached"`
internal/llm/agent/mcp-tools.go+4
@@ -188,6 +188,10 @@ func GetMcpTools(ctx context.Context, permissions permission.Service, cfg *confi
188 return mcpTools
188 return mcpTools
190 for name, m := range cfg.MCP {
190 for name, m := range cfg.MCP {
192+ slog.Debug("skipping disabled mcp", "name", name)
191 switch m.Type {
195 switch m.Type {
192 case config.MCPStdio:
196 case config.MCPStdio:
193 c, err := client.NewStdioMCPClient(
197 c, err := client.NewStdioMCPClient(
@@ -6,14 +6,18 @@ import (
7 "runtime/debug"
7 "runtime/debug"
11 "gopkg.in/natefinch/lumberjack.v2"
12 "gopkg.in/natefinch/lumberjack.v2"
14−var initOnce sync.Once
16+ initOnce sync.Once
17+ initialized atomic.Bool
16−func Init(logFile string, debug bool) {
20+func Setup(logFile string, debug bool) {
17 initOnce.Do(func() {
21 initOnce.Do(func() {
18 logRotator := &lumberjack.Logger{
22 logRotator := &lumberjack.Logger{
19 Filename: logFile,
23 Filename: logFile,
@@ -34,9 +38,14 @@ func Init(logFile string, debug bool) {
36 slog.SetDefault(slog.New(logger))
40 slog.SetDefault(slog.New(logger))
41+ initialized.Store(true)
45+func Initialized() bool {
46+ return initialized.Load()
40func RecoverPanic(name string, cleanup func()) {
49func RecoverPanic(name string, cleanup func()) {
41 if r := recover(); r != nil {
50 if r := recover(); r != nil {
42 // Create a timestamped panic log file
51 // Create a timestamped panic log file
internal/tui/components/anim/anim.go+3−2
@@ -261,7 +261,7 @@ func (a Anim) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
263// View renders the current state of the animation.
263// View renders the current state of the animation.
264−func (a Anim) View() tea.View {
264+func (a Anim) View() string {
265 var b strings.Builder
265 var b strings.Builder
266 for i := range a.width {
266 for i := range a.width {
@@ -284,7 +284,8 @@ func (a Anim) View() tea.View {
284 if a.initialized && a.labelWidth > 0 {
284 if a.initialized && a.labelWidth > 0 {
285 b.WriteString(a.ellipsisFrames[a.ellipsisStep/ellipsisAnimSpeed])
285 b.WriteString(a.ellipsisFrames[a.ellipsisStep/ellipsisAnimSpeed])
287− return tea.NewView(b.String())
288+ return b.String()
290// Step is a command that triggers the next step in the animation.
291// Step is a command that triggers the next step in the animation.
internal/tui/components/anim/example/main.go+3−3
@@ -50,20 +50,20 @@ func (m model) View() tea.View {
52 v := tea.NewView("")
52 v := tea.NewView("")
53− v.SetBackgroundColor(m.bgColor)
53+ v.BackgroundColor = m.bgColor
55 if m.quitting {
55 if m.quitting {
59 if a, ok := m.anim.(anim.Anim); ok {
59 if a, ok := m.anim.(anim.Anim); ok {
60− l := lipgloss.NewLayer(a.View().String()).
60+ l := lipgloss.NewLayer(a.View()).
61 Width(a.Width()).
61 Width(a.Width()).
62 X(m.w/2 - a.Width()/2).
62 X(m.w/2 - a.Width()/2).
63 Y(m.h / 2)
63 Y(m.h / 2)
65 v = tea.NewView(lipgloss.NewCanvas(l))
65 v = tea.NewView(lipgloss.NewCanvas(l))
66− v.SetBackgroundColor(m.bgColor)
66+ v.BackgroundColor = m.bgColor
internal/tui/components/chat/chat.go+8−10
@@ -104,17 +104,15 @@ func (m *messageListCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
106// View renders the message list or an initial screen if empty.
106// View renders the message list or an initial screen if empty.
107−func (m *messageListCmp) View() tea.View {
107+func (m *messageListCmp) View() string {
108 t := styles.CurrentTheme()
108 t := styles.CurrentTheme()
110− t.S().Base.
109+ return t.S().Base.
111− Padding(1).
110+ Padding(1).
112− Width(m.width).
111+ Width(m.width).
113− Height(m.height).
112+ Height(m.height).
115− m.listCmp.View().String(),
114+ m.listCmp.View(),
120// handleChildSession handles messages from child sessions (agent tools).
118// handleChildSession handles messages from child sessions (agent tools).
internal/tui/components/chat/editor/editor.go+9−8
@@ -35,6 +35,7 @@ type Editor interface {
35 layout.Positional
35 layout.Positional
37 SetSession(session session.Session) tea.Cmd
37 SetSession(session session.Session) tea.Cmd
40type FileCompletionItem struct {
41type FileCompletionItem struct {
@@ -269,20 +270,22 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
269 return m, tea.Batch(cmds...)
270 return m, tea.Batch(cmds...)
272−func (m *editorCmp) View() tea.View {
273+func (m *editorCmp) Cursor() *tea.Cursor {
273− t := styles.CurrentTheme()
274 cursor := m.textarea.Cursor()
274 cursor := m.textarea.Cursor()
275 if cursor != nil {
275 if cursor != nil {
276 cursor.X = cursor.X + m.x + 1
276 cursor.X = cursor.X + m.x + 1
277 cursor.Y = cursor.Y + m.y + 1 // adjust for padding
277 cursor.Y = cursor.Y + m.y + 1 // adjust for padding
282+func (m *editorCmp) View() string {
283+ t := styles.CurrentTheme()
279 if len(m.attachments) == 0 {
284 if len(m.attachments) == 0 {
280 content := t.S().Base.Padding(1).Render(
285 content := t.S().Base.Padding(1).Render(
281 m.textarea.View(),
286 m.textarea.View(),
283− view := tea.NewView(content)
284− view.SetCursor(cursor)
285− return view
288+ return content
287 content := t.S().Base.Padding(0, 1, 1, 1).Render(
290 content := t.S().Base.Padding(0, 1, 1, 1).Render(
288 lipgloss.JoinVertical(lipgloss.Top,
291 lipgloss.JoinVertical(lipgloss.Top,
@@ -290,9 +293,7 @@ func (m *editorCmp) View() tea.View {
290 m.textarea.View(),
293 m.textarea.View(),
293− view := tea.NewView(content)
294− view.SetCursor(cursor)
295− return view
296+ return content
298func (m *editorCmp) SetSize(width, height int) tea.Cmd {
299func (m *editorCmp) SetSize(width, height int) tea.Cmd {
internal/tui/components/chat/header/header.go+3−3
@@ -53,9 +53,9 @@ func (p *header) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
53 return p, nil
53 return p, nil
56−func (p *header) View() tea.View {
56+func (p *header) View() string {
57 if p.session.ID == "" {
57 if p.session.ID == "" {
58− return tea.NewView("")
58+ return ""
61 t := styles.CurrentTheme()
61 t := styles.CurrentTheme()
@@ -82,7 +82,7 @@ func (p *header) View() tea.View {
85− return tea.NewView(content)
85+ return content
88func (h *header) details() string {
88func (h *header) details() string {
internal/tui/components/chat/messages/messages.go+10−12
@@ -89,20 +89,20 @@ func (m *messageCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
90// View renders the message component based on its current state.
90// View renders the message component based on its current state.
91// Returns different views for spinning, user, and assistant messages.
91// Returns different views for spinning, user, and assistant messages.
92−func (m *messageCmp) View() tea.View {
92+func (m *messageCmp) View() string {
93 if m.spinning {
93 if m.spinning {
94− return tea.NewView(m.style().PaddingLeft(1).Render(m.anim.View().String()))
94+ return m.style().PaddingLeft(1).Render(m.anim.View())
96 if m.message.ID != "" {
96 if m.message.ID != "" {
97 // this is a user or assistant message
97 // this is a user or assistant message
98 switch m.message.Role {
98 switch m.message.Role {
99 case message.User:
99 case message.User:
100− return tea.NewView(m.renderUserMessage())
100+ return m.renderUserMessage()
102− return tea.NewView(m.renderAssistantMessage())
102+ return m.renderAssistantMessage()
105− return tea.NewView(m.style().Render("No message content"))
105+ return m.style().Render("No message content")
108// GetMessage returns the underlying message data
108// GetMessage returns the underlying message data
@@ -289,7 +289,7 @@ func (m *assistantSectionModel) Update(tea.Msg) (tea.Model, tea.Cmd) {
289 return m, nil
289 return m, nil
292−func (m *assistantSectionModel) View() tea.View {
292+func (m *assistantSectionModel) View() string {
293 t := styles.CurrentTheme()
293 t := styles.CurrentTheme()
294 finishData := m.message.FinishPart()
294 finishData := m.message.FinishPart()
295 finishTime := time.Unix(finishData.Time, 0)
295 finishTime := time.Unix(finishData.Time, 0)
@@ -300,15 +300,13 @@ func (m *assistantSectionModel) View() tea.View {
300 if model == nil {
300 if model == nil {
301 // This means the model is not configured anymore
301 // This means the model is not configured anymore
302 model = &provider.Model{
302 model = &provider.Model{
303− Name: "Unknown Model",
303+ Model: "Unknown Model",
306− modelFormatted := t.S().Muted.Render(model.Name)
306+ modelFormatted := t.S().Muted.Render(model.Model)
307 assistant := fmt.Sprintf("%s %s %s", icon, modelFormatted, infoMsg)
307 assistant := fmt.Sprintf("%s %s %s", icon, modelFormatted, infoMsg)
309− t.S().Base.PaddingLeft(2).Render(
308+ return t.S().Base.PaddingLeft(2).Render(
310− core.Section(assistant, m.width-2),
309+ core.Section(assistant, m.width-2),
internal/tui/components/chat/messages/renderer.go+1−1
@@ -542,7 +542,7 @@ func (tr agentRenderer) Render(v *toolCallCmp) string {
543 if v.result.ToolCallID == "" {
543 if v.result.ToolCallID == "" {
544 v.spinning = true
544 v.spinning = true
545− parts = append(parts, v.anim.View().String())
545+ parts = append(parts, v.anim.View())
547 v.spinning = false
547 v.spinning = false
internal/tui/components/chat/messages/tool.go+4−4
@@ -145,19 +145,19 @@ func (m *toolCallCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
146// View renders the tool call component based on its current state.
146// View renders the tool call component based on its current state.
147// Shows either a pending animation or the tool-specific rendered result.
147// Shows either a pending animation or the tool-specific rendered result.
148−func (m *toolCallCmp) View() tea.View {
148+func (m *toolCallCmp) View() string {
149 box := m.style()
149 box := m.style()
151 if !m.call.Finished && !m.cancelled {
151 if !m.call.Finished && !m.cancelled {
152− return tea.NewView(box.Render(m.renderPending()))
152+ return box.Render(m.renderPending())
155 r := registry.lookup(m.call.Name)
155 r := registry.lookup(m.call.Name)
157 if m.isNested {
157 if m.isNested {
158− return tea.NewView(box.Render(r.Render(m)))
158+ return box.Render(r.Render(m))
160− return tea.NewView(box.Render(r.Render(m)))
160+ return box.Render(r.Render(m))
163// State management methods
163// State management methods
internal/tui/components/chat/sidebar/sidebar.go+18−19
@@ -97,7 +97,7 @@ func (m *sidebarCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
97 return m, nil
97 return m, nil
100−func (m *sidebarCmp) View() tea.View {
100+func (m *sidebarCmp) View() string {
101 t := styles.CurrentTheme()
101 t := styles.CurrentTheme()
102 parts := []string{}
102 parts := []string{}
103 if !m.compactMode {
103 if !m.compactMode {
@@ -129,19 +129,15 @@ func (m *sidebarCmp) View() tea.View {
129 m.mcpBlock(),
129 m.mcpBlock(),
132− // TODO: CHECK out why we need to set the background here weird issue
133 style := t.S().Base.
132 style := t.S().Base.
134− Background(t.BgBase).
135 Width(m.width).
133 Width(m.width).
136 Height(m.height).
134 Height(m.height).
137 Padding(1)
135 Padding(1)
138 if m.compactMode {
136 if m.compactMode {
139 style = style.PaddingTop(0)
137 style = style.PaddingTop(0)
142− style.Render(
139+ return style.Render(
143− lipgloss.JoinVertical(lipgloss.Left, parts...),
140+ lipgloss.JoinVertical(lipgloss.Left, parts...),
@@ -335,7 +331,7 @@ func (m *sidebarCmp) lspBlock() string {
336 lspList := []string{section, ""}
332 lspList := []string{section, ""}
338− lsp := config.Get().LSP
334+ lsp := config.Get().LSP.Sorted()
339 if len(lsp) == 0 {
335 if len(lsp) == 0 {
340 return lipgloss.JoinVertical(
336 return lipgloss.JoinVertical(
341 lipgloss.Left,
337 lipgloss.Left,
@@ -345,9 +341,9 @@ func (m *sidebarCmp) lspBlock() string {
348− for n, l := range lsp {
344+ for _, l := range lsp {
349 iconColor := t.Success
345 iconColor := t.Success
350− if l.Disabled {
346+ if l.LSP.Disabled {
351 iconColor = t.FgMuted
347 iconColor = t.FgMuted
353 lspErrs := map[protocol.DiagnosticSeverity]int{
349 lspErrs := map[protocol.DiagnosticSeverity]int{
@@ -356,7 +352,7 @@ func (m *sidebarCmp) lspBlock() string {
356 protocol.SeverityHint: 0,
352 protocol.SeverityHint: 0,
357 protocol.SeverityInformation: 0,
353 protocol.SeverityInformation: 0,
359− if client, ok := m.lspClients[n]; ok {
355+ if client, ok := m.lspClients[l.Name]; ok {
360 for _, diagnostics := range client.GetDiagnostics() {
356 for _, diagnostics := range client.GetDiagnostics() {
361 for _, diagnostic := range diagnostics {
357 for _, diagnostic := range diagnostics {
362 if severity, ok := lspErrs[diagnostic.Severity]; ok {
358 if severity, ok := lspErrs[diagnostic.Severity]; ok {
@@ -384,8 +380,8 @@ func (m *sidebarCmp) lspBlock() string {
384 core.Status(
380 core.Status(
385 core.StatusOpts{
381 core.StatusOpts{
386 IconColor: iconColor,
382 IconColor: iconColor,
387− Title: n,
383+ Title: l.Name,
388− Description: l.Command,
384+ Description: l.LSP.Command,
389 ExtraContent: strings.Join(errs, " "),
385 ExtraContent: strings.Join(errs, " "),
391 m.getMaxWidth(),
387 m.getMaxWidth(),
@@ -408,8 +404,8 @@ func (m *sidebarCmp) mcpBlock() string {
409 mcpList := []string{section, ""}
405 mcpList := []string{section, ""}
411− mcp := config.Get().MCP
407+ mcps := config.Get().MCP.Sorted()
412− if len(mcp) == 0 {
408+ if len(mcps) == 0 {
413 return lipgloss.JoinVertical(
409 return lipgloss.JoinVertical(
414 lipgloss.Left,
410 lipgloss.Left,
@@ -418,14 +414,17 @@ func (m *sidebarCmp) mcpBlock() string {
421− for n, l := range mcp {
417+ for _, l := range mcps {
422 iconColor := t.Success
418 iconColor := t.Success
420+ iconColor = t.FgMuted
423 mcpList = append(mcpList,
422 mcpList = append(mcpList,
424 core.Status(
423 core.Status(
425 core.StatusOpts{
424 core.StatusOpts{
426 IconColor: iconColor,
425 IconColor: iconColor,
427− Title: n,
426+ Title: l.Name,
428− Description: l.Command,
427+ Description: l.MCP.Command,
430 m.getMaxWidth(),
429 m.getMaxWidth(),
@@ -483,7 +482,7 @@ func (s *sidebarCmp) currentModelBlock() string {
483 t := styles.CurrentTheme()
482 t := styles.CurrentTheme()
485 modelIcon := t.S().Base.Foreground(t.FgSubtle).Render(styles.ModelIcon)
484 modelIcon := t.S().Base.Foreground(t.FgSubtle).Render(styles.ModelIcon)
486− modelName := t.S().Text.Render(model.Name)
485+ modelName := t.S().Text.Render(model.Model)
487 modelInfo := fmt.Sprintf("%s %s", modelIcon, modelName)
486 modelInfo := fmt.Sprintf("%s %s", modelIcon, modelName)
488 parts := []string{
487 parts := []string{
489 modelInfo,
488 modelInfo,
internal/tui/components/chat/splash/splash.go+34−29
@@ -25,6 +25,7 @@ type Splash interface {
25 util.Model
25 util.Model
26 layout.Sizeable
26 layout.Sizeable
27 layout.Help
27 layout.Help
28 // SetOnboarding controls whether the splash shows model selection UI
29 // SetOnboarding controls whether the splash shows model selection UI
29 SetOnboarding(bool)
30 SetOnboarding(bool)
30 // SetProjectInit controls whether the splash shows project initialization prompt
31 // SetProjectInit controls whether the splash shows project initialization prompt
@@ -40,15 +41,15 @@ const (
40type OnboardingCompleteMsg struct{}
41type OnboardingCompleteMsg struct{}
42type splashCmp struct {
43type splashCmp struct {
43− width, height int
44+ width, height int
44− keyMap KeyMap
45+ keyMap KeyMap
45− logoRendered string
46+ logoRendered string
48 isOnboarding bool
49 isOnboarding bool
49 needsProjectInit bool
50 needsProjectInit bool
50 selectedNo bool
51 selectedNo bool
52 modelList *models.ModelListComponent
53 modelList *models.ModelListComponent
53 cursorRow, cursorCol int
54 cursorRow, cursorCol int
@@ -69,12 +70,12 @@ func New() Splash {
69 inputStyle := t.S().Base.Padding(0, 1, 0, 1)
70 inputStyle := t.S().Base.Padding(0, 1, 0, 1)
70 modelList := models.NewModelListComponent(listKeyMap, inputStyle, "Find your fave")
71 modelList := models.NewModelListComponent(listKeyMap, inputStyle, "Find your fave")
71 return &splashCmp{
72 return &splashCmp{
72− width: 0,
73+ width: 0,
73− height: 0,
74+ height: 0,
74− keyMap: keyMap,
75+ keyMap: keyMap,
75− logoRendered: "",
76+ logoRendered: "",
76− modelList: modelList,
77+ modelList: modelList,
77− selectedNo: false,
78+ selectedNo: false,
@@ -278,22 +279,19 @@ func (s *splashCmp) isProviderConfigured(providerID string) bool {
278 return false
279 return false
281−// View implements SplashPage.
282−func (s *splashCmp) View() tea.View {
282+func (s *splashCmp) View() string {
283 t := styles.CurrentTheme()
283 t := styles.CurrentTheme()
284− var cursor *tea.Cursor
286 var content string
285 var content string
287 if s.isOnboarding {
286 if s.isOnboarding {
288 remainingHeight := s.height - lipgloss.Height(s.logoRendered) - (SplashScreenPaddingY * 2)
287 remainingHeight := s.height - lipgloss.Height(s.logoRendered) - (SplashScreenPaddingY * 2)
289 modelListView := s.modelList.View()
288 modelListView := s.modelList.View()
290− cursor = s.moveCursor(modelListView.Cursor())
291 modelSelector := t.S().Base.AlignVertical(lipgloss.Bottom).Height(remainingHeight).Render(
289 modelSelector := t.S().Base.AlignVertical(lipgloss.Bottom).Height(remainingHeight).Render(
292 lipgloss.JoinVertical(
290 lipgloss.JoinVertical(
293 lipgloss.Left,
291 lipgloss.Left,
294 t.S().Base.PaddingLeft(1).Foreground(t.Primary).Render("Choose a Model"),
292 t.S().Base.PaddingLeft(1).Foreground(t.Primary).Render("Choose a Model"),
296− modelListView.String(),
294+ modelListView,
299 content = lipgloss.JoinVertical(
297 content = lipgloss.JoinVertical(
@@ -354,19 +352,26 @@ func (s *splashCmp) View() tea.View {
354 content = s.logoRendered
352 content = s.logoRendered
357− view := tea.NewView(
358− t.S().Base.
355+ return t.S().Base.
359− Width(s.width).
356+ Width(s.width).
360− Height(s.height).
357+ Height(s.height).
361− PaddingTop(SplashScreenPaddingY).
358+ PaddingTop(SplashScreenPaddingY).
362− PaddingLeft(SplashScreenPaddingX).
359+ PaddingLeft(SplashScreenPaddingX).
363− PaddingRight(SplashScreenPaddingX).
360+ PaddingRight(SplashScreenPaddingX).
364− PaddingBottom(SplashScreenPaddingY).
361+ PaddingBottom(SplashScreenPaddingY).
365− Render(content),
362+ Render(content)
368− view.SetCursor(cursor)
365+func (s *splashCmp) Cursor() *tea.Cursor {
367+ cursor := s.modelList.Cursor()
369+ return s.moveCursor(cursor)
369− return view
374+ return nil
372func (s *splashCmp) logoBlock() string {
377func (s *splashCmp) logoBlock() string {
internal/tui/components/completions/completions.go+3−6
@@ -157,15 +157,12 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
159// View implements Completions.
159// View implements Completions.
160−func (c *completionsCmp) View() tea.View {
160+func (c *completionsCmp) View() string {
161 if len(c.list.Items()) == 0 {
161 if len(c.list.Items()) == 0 {
162− return tea.NewView(c.style().Render("No completions found"))
162+ return c.style().Render("No completions found")
165− view := tea.NewView(
166− c.style().Render(c.list.View().String()),
165+ return c.style().Render(c.list.View())
171func (c *completionsCmp) style() lipgloss.Style {
168func (c *completionsCmp) style() lipgloss.Style {
internal/tui/components/completions/item.go+2−2
@@ -75,7 +75,7 @@ func (c *completionItemCmp) Update(tea.Msg) (tea.Model, tea.Cmd) {
77// View implements CommandItem.
77// View implements CommandItem.
78−func (c *completionItemCmp) View() tea.View {
78+func (c *completionItemCmp) View() string {
79 t := styles.CurrentTheme()
79 t := styles.CurrentTheme()
81 itemStyle := t.S().Base.Padding(0, 1).Width(c.width)
81 itemStyle := t.S().Base.Padding(0, 1).Width(c.width)
@@ -135,7 +135,7 @@ func (c *completionItemCmp) View() tea.View {
135 parts...,
135 parts...,
138− return tea.NewView(item)
138+ return item
141// Blur implements CommandItem.
141// Blur implements CommandItem.
internal/tui/components/core/layout/container.go+9−5
@@ -72,7 +72,14 @@ func (c *container) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
75−func (c *container) View() tea.View {
75+func (c *container) Cursor() *tea.Cursor {
76+ if cursor, ok := c.content.(util.Cursor); ok {
77+ return cursor.Cursor()
82+func (c *container) View() string {
76 t := styles.CurrentTheme()
83 t := styles.CurrentTheme()
77 width := c.width
84 width := c.width
78 height := c.height
85 height := c.height
@@ -106,10 +113,7 @@ func (c *container) View() tea.View {
106 PaddingLeft(c.paddingLeft)
113 PaddingLeft(c.paddingLeft)
108 contentView := c.content.View()
115 contentView := c.content.View()
109− view := tea.NewView(style.Render(contentView.String()))
116+ return style.Render(contentView)
110− cursor := contentView.Cursor()
111− view.SetCursor(cursor)
115func (c *container) SetSize(width, height int) tea.Cmd {
119func (c *container) SetSize(width, height int) tea.Cmd {
internal/tui/components/core/layout/split.go+24−19
@@ -103,17 +103,34 @@ func (s *splitPaneLayout) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
103 return s, tea.Batch(cmds...)
103 return s, tea.Batch(cmds...)
106−func (s *splitPaneLayout) View() tea.View {
106+func (s *splitPaneLayout) Cursor() *tea.Cursor {
107+ if s.bottomPanel != nil {
108+ if c, ok := s.bottomPanel.(util.Cursor); ok {
111+ } else if s.rightPanel != nil {
112+ if c, ok := s.rightPanel.(util.Cursor); ok {
115+ } else if s.leftPanel != nil {
116+ if c, ok := s.leftPanel.(util.Cursor); ok {
123+func (s *splitPaneLayout) View() string {
107 var topSection string
124 var topSection string
109 if s.leftPanel != nil && s.rightPanel != nil {
126 if s.leftPanel != nil && s.rightPanel != nil {
110 leftView := s.leftPanel.View()
127 leftView := s.leftPanel.View()
111 rightView := s.rightPanel.View()
128 rightView := s.rightPanel.View()
112− topSection = lipgloss.JoinHorizontal(lipgloss.Top, leftView.String(), rightView.String())
129+ topSection = lipgloss.JoinHorizontal(lipgloss.Top, leftView, rightView)
113 } else if s.leftPanel != nil {
130 } else if s.leftPanel != nil {
114− topSection = s.leftPanel.View().String()
131+ topSection = s.leftPanel.View()
115 } else if s.rightPanel != nil {
132 } else if s.rightPanel != nil {
116− topSection = s.rightPanel.View().String()
133+ topSection = s.rightPanel.View()
118 topSection = ""
135 topSection = ""
@@ -122,32 +139,20 @@ func (s *splitPaneLayout) View() tea.View {
123 if s.bottomPanel != nil && topSection != "" {
140 if s.bottomPanel != nil && topSection != "" {
124 bottomView := s.bottomPanel.View()
141 bottomView := s.bottomPanel.View()
125− finalView = lipgloss.JoinVertical(lipgloss.Left, topSection, bottomView.String())
142+ finalView = lipgloss.JoinVertical(lipgloss.Left, topSection, bottomView)
126 } else if s.bottomPanel != nil {
143 } else if s.bottomPanel != nil {
127− finalView = s.bottomPanel.View().String()
144+ finalView = s.bottomPanel.View()
129 finalView = topSection
146 finalView = topSection
132− // TODO: think of a better way to handle multiple cursors
133− var cursor *tea.Cursor
134− if s.bottomPanel != nil {
135− cursor = s.bottomPanel.View().Cursor()
136− } else if s.rightPanel != nil {
137− cursor = s.rightPanel.View().Cursor()
138− } else if s.leftPanel != nil {
139− cursor = s.leftPanel.View().Cursor()
142 t := styles.CurrentTheme()
149 t := styles.CurrentTheme()
144 style := t.S().Base.
151 style := t.S().Base.
145 Width(s.width).
152 Width(s.width).
146 Height(s.height)
153 Height(s.height)
148− view := tea.NewView(style.Render(finalView))
155+ return style.Render(finalView)
149− view.SetCursor(cursor)
153func (s *splitPaneLayout) SetSize(width, height int) tea.Cmd {
158func (s *splitPaneLayout) SetSize(width, height int) tea.Cmd {
internal/tui/components/core/list/list.go+14−9
@@ -42,6 +42,7 @@ type ListModel interface {
42 SetSelected(int) tea.Cmd // Set the selected item by index and scroll to it
42 SetSelected(int) tea.Cmd // Set the selected item by index and scroll to it
43 Filter(string) tea.Cmd // Filter items based on a search term
43 Filter(string) tea.Cmd // Filter items based on a search term
44 SetFilterPlaceholder(string) // Set the placeholder text for the filter input
44 SetFilterPlaceholder(string) // Set the placeholder text for the filter input
45+ Cursor() *tea.Cursor // Get the current cursor position in the filter input
47// HasAnim interface identifies items that support animation.
48// HasAnim interface identifies items that support animation.
@@ -281,12 +282,20 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
281 return m, nil
282 return m, nil
285+// Cursor returns the current cursor position in the input field.
286+func (m *model) Cursor() *tea.Cursor {
287+ if m.filterable && !m.hideFilterInput {
288+ return m.input.Cursor()
284// View renders the list to a string for display.
293// View renders the list to a string for display.
285// Returns empty string if the list has no dimensions.
294// Returns empty string if the list has no dimensions.
286// Triggers re-rendering if needed before returning content.
295// Triggers re-rendering if needed before returning content.
287−func (m *model) View() tea.View {
296+func (m *model) View() string {
288 if m.viewState.height == 0 || m.viewState.width == 0 {
297 if m.viewState.height == 0 || m.viewState.width == 0 {
289− return tea.NewView("") // No content to display
298+ return "" // No content to display
291 if m.renderState.needsRerender {
300 if m.renderState.needsRerender {
292 m.renderVisible()
301 m.renderVisible()
@@ -304,11 +313,7 @@ func (m *model) View() tea.View {
307− view := tea.NewView(content)
316+ return content
308− if m.filterable && !m.hideFilterInput {
309− view.SetCursor(m.input.Cursor())
314// handleKeyPress processes keyboard input for list navigation.
319// handleKeyPress processes keyboard input for list navigation.
@@ -834,7 +839,7 @@ func (m *model) rerenderItem(inx int) {
834func (m *model) getItemLines(item util.Model) []string {
839func (m *model) getItemLines(item util.Model) []string {
835 var itemLines []string
840 var itemLines []string
837− itemLines = strings.Split(item.View().String(), "\n")
842+ itemLines = strings.Split(item.View(), "\n")
839 if m.gapSize > 0 {
844 if m.gapSize > 0 {
840 gap := make([]string, m.gapSize)
845 gap := make([]string, m.gapSize)
@@ -1262,7 +1267,7 @@ func (m *model) filterSection(sect section, search string) *section {
1263 // Check if section header itself matches
1268 // Check if section header itself matches
1264 if sect.header != nil {
1269 if sect.header != nil {
1265− headerText := strings.ToLower(sect.header.View().String())
1270+ headerText := strings.ToLower(sect.header.View())
1266 if strings.Contains(headerText, search) {
1271 if strings.Contains(headerText, search) {
1267 hasHeaderMatch = true
1272 hasHeaderMatch = true
1268 // If header matches, include all items in the section
1273 // If header matches, include all items in the section
internal/tui/components/core/status/status.go+2−2
@@ -60,13 +60,13 @@ func (m *statusCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
60 return m, nil
60 return m, nil
63−func (m *statusCmp) View() tea.View {
63+func (m *statusCmp) View() string {
64 t := styles.CurrentTheme()
64 t := styles.CurrentTheme()
65 status := t.S().Base.Padding(0, 1, 1, 1).Render(m.help.View(m.keyMap))
65 status := t.S().Base.Padding(0, 1, 1, 1).Render(m.help.View(m.keyMap))
66 if m.info.Msg != "" {
66 if m.info.Msg != "" {
67 status = m.infoMsg()
67 status = m.infoMsg()
69− return tea.NewView(status)
69+ return status
72func (m *statusCmp) infoMsg() string {
72func (m *statusCmp) infoMsg() string {
internal/tui/components/dialogs/commands/arguments.go+10−10
@@ -139,7 +139,7 @@ func (c *commandArgumentsDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
141// View implements CommandArgumentsDialog.
141// View implements CommandArgumentsDialog.
142−func (c *commandArgumentsDialogCmp) View() tea.View {
142+func (c *commandArgumentsDialogCmp) View() string {
143 t := styles.CurrentTheme()
143 t := styles.CurrentTheme()
144 baseStyle := t.S().Base
144 baseStyle := t.S().Base
@@ -188,19 +188,19 @@ func (c *commandArgumentsDialogCmp) View() tea.View {
188 elements...,
188 elements...,
191− view := tea.NewView(
192− baseStyle.Padding(1, 1, 0, 1).
191+ return baseStyle.Padding(1, 1, 0, 1).
193− Border(lipgloss.RoundedBorder()).
192+ Border(lipgloss.RoundedBorder()).
194− BorderForeground(t.BorderFocus).
193+ BorderForeground(t.BorderFocus).
195− Width(c.width).
194+ Width(c.width).
196− Render(content),
195+ Render(content)
198+func (c *commandArgumentsDialogCmp) Cursor() *tea.Cursor {
198 cursor := c.inputs[c.focusIndex].Cursor()
199 cursor := c.inputs[c.focusIndex].Cursor()
199 if cursor != nil {
200 if cursor != nil {
200 cursor = c.moveCursor(cursor)
201 cursor = c.moveCursor(cursor)
202− view.SetCursor(cursor)
203− return view
203+ return cursor
206func (c *commandArgumentsDialogCmp) moveCursor(cursor *tea.Cursor) *tea.Cursor {
206func (c *commandArgumentsDialogCmp) moveCursor(cursor *tea.Cursor) *tea.Cursor {
internal/tui/components/dialogs/commands/commands.go+14−8
@@ -143,23 +143,29 @@ func (c *commandDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
143 return c, nil
143 return c, nil
146−func (c *commandDialogCmp) View() tea.View {
146+func (c *commandDialogCmp) View() string {
147 t := styles.CurrentTheme()
147 t := styles.CurrentTheme()
148− listView := c.commandList.View()
148+ listView := c.commandList
149 radio := c.commandTypeRadio()
149 radio := c.commandTypeRadio()
150 content := lipgloss.JoinVertical(
150 content := lipgloss.JoinVertical(
151 lipgloss.Left,
151 lipgloss.Left,
152 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Commands", c.width-lipgloss.Width(radio)-5)+" "+radio),
152 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Commands", c.width-lipgloss.Width(radio)-5)+" "+radio),
153− listView.String(),
153+ listView.View(),
155 t.S().Base.Width(c.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(c.help.View(c.keyMap)),
155 t.S().Base.Width(c.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(c.help.View(c.keyMap)),
157− v := tea.NewView(c.style().Render(content))
157+ return c.style().Render(content)
158− if listView.Cursor() != nil {
158+}
160+func (c *commandDialogCmp) Cursor() *tea.Cursor {
161+ if cursor, ok := c.commandList.(util.Cursor); ok {
162+ cursor := cursor.Cursor()
159− c := c.moveCursor(listView.Cursor())
164+ cursor = c.moveCursor(cursor)
160− v.SetCursor(c)
165+ }
162− return v
168+ return nil
165func (c *commandDialogCmp) commandTypeRadio() string {
171func (c *commandDialogCmp) commandTypeRadio() string {
internal/tui/components/dialogs/commands/item.go+2−2
@@ -36,7 +36,7 @@ func (m *itemSectionModel) Update(tea.Msg) (tea.Model, tea.Cmd) {
36 return m, nil
36 return m, nil
39−func (m *itemSectionModel) View() tea.View {
39+func (m *itemSectionModel) View() string {
40 t := styles.CurrentTheme()
40 t := styles.CurrentTheme()
41 title := ansi.Truncate(m.title, m.width-2, "…")
41 title := ansi.Truncate(m.title, m.width-2, "…")
42 style := t.S().Base.Padding(1, 1, 0, 1)
42 style := t.S().Base.Padding(1, 1, 0, 1)
@@ -48,7 +48,7 @@ func (m *itemSectionModel) View() tea.View {
48 section = core.Section(title, m.width-2)
48 section = core.Section(title, m.width-2)
51− return tea.NewView(style.Render(section))
51+ return style.Render(section)
54func (m *itemSectionModel) GetSize() (int, int) {
54func (m *itemSectionModel) GetSize() (int, int) {
internal/tui/components/dialogs/compact/compact.go+2−2
@@ -242,8 +242,8 @@ func (c *compactDialogCmp) render() string {
242 Render(dialogContent)
242 Render(dialogContent)
245−func (c *compactDialogCmp) View() tea.View {
245+func (c *compactDialogCmp) View() string {
246− return tea.NewView(c.render())
246+ return c.render()
249// SetSize sets the size of the component.
249// SetSize sets the size of the component.
internal/tui/components/dialogs/dialogs.go+4−5
@@ -37,7 +37,7 @@ type DialogCmp interface {
37 Dialogs() []DialogModel
37 Dialogs() []DialogModel
38 HasDialogs() bool
38 HasDialogs() bool
39 GetLayers() []*lipgloss.Layer
39 GetLayers() []*lipgloss.Layer
40− ActiveView() *tea.View
40+ ActiveModel() util.Model
41 ActiveDialogID() DialogID
41 ActiveDialogID() DialogID
@@ -132,12 +132,11 @@ func (d dialogCmp) Dialogs() []DialogModel {
132 return d.dialogs
132 return d.dialogs
135−func (d dialogCmp) ActiveView() *tea.View {
135+func (d dialogCmp) ActiveModel() util.Model {
136 if len(d.dialogs) == 0 {
136 if len(d.dialogs) == 0 {
137 return nil
137 return nil
139− view := d.dialogs[len(d.dialogs)-1].View()
139+ return d.dialogs[len(d.dialogs)-1]
143func (d dialogCmp) ActiveDialogID() DialogID {
142func (d dialogCmp) ActiveDialogID() DialogID {
@@ -150,7 +149,7 @@ func (d dialogCmp) ActiveDialogID() DialogID {
150func (d dialogCmp) GetLayers() []*lipgloss.Layer {
149func (d dialogCmp) GetLayers() []*lipgloss.Layer {
151 layers := []*lipgloss.Layer{}
150 layers := []*lipgloss.Layer{}
152 for _, dialog := range d.Dialogs() {
151 for _, dialog := range d.Dialogs() {
153− dialogView := dialog.View().String()
152+ dialogView := dialog.View()
154 row, col := dialog.Position()
153 row, col := dialog.Position()
155 layers = append(layers, lipgloss.NewLayer(dialogView).X(col).Y(row))
154 layers = append(layers, lipgloss.NewLayer(dialogView).X(col).Y(row))
internal/tui/components/dialogs/filepicker/filepicker.go+2−2
@@ -144,7 +144,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
144 return m, tea.Batch(cmds...)
144 return m, tea.Batch(cmds...)
147−func (m *model) View() tea.View {
147+func (m *model) View() string {
148 t := styles.CurrentTheme()
148 t := styles.CurrentTheme()
150 content := lipgloss.JoinVertical(
150 content := lipgloss.JoinVertical(
@@ -154,7 +154,7 @@ func (m *model) View() tea.View {
154 m.filePicker.View(),
154 m.filePicker.View(),
155 t.S().Base.Width(m.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(m.help.View(m.keyMap)),
155 t.S().Base.Width(m.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(m.help.View(m.keyMap)),
157− return tea.NewView(m.style().Render(content))
157+ return m.style().Render(content)
160func (m *model) currentImage() string {
160func (m *model) currentImage() string {
internal/tui/components/dialogs/models/apikey.go+6−4
@@ -50,7 +50,7 @@ func (a *APIKeyInput) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
50 return a, cmd
50 return a, cmd
53−func (a *APIKeyInput) View() tea.View {
53+func (a *APIKeyInput) View() string {
54 t := styles.CurrentTheme()
54 t := styles.CurrentTheme()
56 title := t.S().Base.
56 title := t.S().Base.
@@ -74,13 +74,15 @@ func (a *APIKeyInput) View() tea.View {
77− view := tea.NewView(content)
77+ return content
80+func (a *APIKeyInput) Cursor() *tea.Cursor {
78 cursor := a.input.Cursor()
81 cursor := a.input.Cursor()
79 if cursor != nil {
82 if cursor != nil {
80 cursor.Y += 2 // Adjust for title and spacing
83 cursor.Y += 2 // Adjust for title and spacing
82− view.SetCursor(cursor)
83− return view
85+ return cursor
86func (a *APIKeyInput) Value() string {
88func (a *APIKeyInput) Value() string {
internal/tui/components/dialogs/models/list.go+8−4
@@ -55,10 +55,14 @@ func (m *ModelListComponent) Update(msg tea.Msg) (*ModelListComponent, tea.Cmd)
55 return m, cmd
55 return m, cmd
58−func (m *ModelListComponent) View() tea.View {
58+func (m *ModelListComponent) View() string {
59 return m.list.View()
59 return m.list.View()
62+func (m *ModelListComponent) Cursor() *tea.Cursor {
63+ return m.list.Cursor()
62func (m *ModelListComponent) SetSize(width, height int) tea.Cmd {
66func (m *ModelListComponent) SetSize(width, height int) tea.Cmd {
63 return m.list.SetSize(width, height)
67 return m.list.SetSize(width, height)
@@ -113,7 +117,7 @@ func (m *ModelListComponent) SetModelType(modelType int) tea.Cmd {
113 for i, model := range providerConfig.Models {
117 for i, model := range providerConfig.Models {
114 configProvider.Models[i] = provider.Model{
118 configProvider.Models[i] = provider.Model{
115 ID: model.ID,
119 ID: model.ID,
116− Name: model.Name,
120+ Model: model.Model,
117 CostPer1MIn: model.CostPer1MIn,
121 CostPer1MIn: model.CostPer1MIn,
118 CostPer1MOut: model.CostPer1MOut,
122 CostPer1MOut: model.CostPer1MOut,
119 CostPer1MInCached: model.CostPer1MInCached,
123 CostPer1MInCached: model.CostPer1MInCached,
@@ -136,7 +140,7 @@ func (m *ModelListComponent) SetModelType(modelType int) tea.Cmd {
136 section.SetInfo(configured)
140 section.SetInfo(configured)
137 modelItems = append(modelItems, section)
141 modelItems = append(modelItems, section)
138 for _, model := range configProvider.Models {
142 for _, model := range configProvider.Models {
139− modelItems = append(modelItems, completions.NewCompletionItem(model.Name, ModelOption{
143+ modelItems = append(modelItems, completions.NewCompletionItem(model.Model, ModelOption{
140 Provider: configProvider,
144 Provider: configProvider,
141 Model: model,
145 Model: model,
@@ -171,7 +175,7 @@ func (m *ModelListComponent) SetModelType(modelType int) tea.Cmd {
172 modelItems = append(modelItems, section)
176 modelItems = append(modelItems, section)
173 for _, model := range provider.Models {
177 for _, model := range provider.Models {
174− modelItems = append(modelItems, completions.NewCompletionItem(model.Name, ModelOption{
178+ modelItems = append(modelItems, completions.NewCompletionItem(model.Model, ModelOption{
175 Provider: provider,
179 Provider: provider,
176 Model: model,
180 Model: model,
internal/tui/components/dialogs/models/models.go+11−7
@@ -142,23 +142,27 @@ func (m *modelDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
142 return m, nil
142 return m, nil
145−func (m *modelDialogCmp) View() tea.View {
145+func (m *modelDialogCmp) View() string {
146 t := styles.CurrentTheme()
146 t := styles.CurrentTheme()
147 listView := m.modelList.View()
147 listView := m.modelList.View()
148 radio := m.modelTypeRadio()
148 radio := m.modelTypeRadio()
149 content := lipgloss.JoinVertical(
149 content := lipgloss.JoinVertical(
150 lipgloss.Left,
150 lipgloss.Left,
151 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Switch Model", m.width-lipgloss.Width(radio)-5)+" "+radio),
151 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Switch Model", m.width-lipgloss.Width(radio)-5)+" "+radio),
152− listView.String(),
152+ listView,
154 t.S().Base.Width(m.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(m.help.View(m.keyMap)),
154 t.S().Base.Width(m.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(m.help.View(m.keyMap)),
156− v := tea.NewView(m.style().Render(content))
156+ return m.style().Render(content)
157− if listView.Cursor() != nil {
157+}
159+func (m *modelDialogCmp) Cursor() *tea.Cursor {
160+ cursor := m.modelList.Cursor()
158− c := m.moveCursor(listView.Cursor())
162+ cursor = m.moveCursor(cursor)
159− v.SetCursor(c)
163+ return cursor
161− return v
165+ return nil
164func (m *modelDialogCmp) style() lipgloss.Style {
168func (m *modelDialogCmp) style() lipgloss.Style {
internal/tui/components/dialogs/permissions/permissions.go+2−2
@@ -478,8 +478,8 @@ func (p *permissionDialogCmp) render() string {
481−func (p *permissionDialogCmp) View() tea.View {
481+func (p *permissionDialogCmp) View() string {
482− return tea.NewView(p.render())
482+ return p.render()
485func (p *permissionDialogCmp) SetSize() tea.Cmd {
485func (p *permissionDialogCmp) SetSize() tea.Cmd {
internal/tui/components/dialogs/quit/quit.go+5−6
@@ -65,7 +65,7 @@ func (q *quitDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
67// View renders the quit dialog with Yes/No buttons.
67// View renders the quit dialog with Yes/No buttons.
68−func (q *quitDialogCmp) View() tea.View {
68+func (q *quitDialogCmp) View() string {
69 t := styles.CurrentTheme()
69 t := styles.CurrentTheme()
70 baseStyle := t.S().Base
70 baseStyle := t.S().Base
71 yesStyle := t.S().Text
71 yesStyle := t.S().Text
@@ -79,8 +79,9 @@ func (q *quitDialogCmp) View() tea.View {
79 noStyle = noStyle.Background(t.BgSubtle)
79 noStyle = noStyle.Background(t.BgSubtle)
82+ const horizontalPadding = 3
82− yesButton := yesStyle.Padding(0, 1).Render("Yep!")
83+ yesButton := yesStyle.Padding(0, horizontalPadding).Render("Yep!")
83− noButton := noStyle.Padding(0, 1).Render("Nope")
84+ noButton := noStyle.Padding(0, horizontalPadding).Render("Nope")
85 buttons := baseStyle.Width(lipgloss.Width(question)).Align(lipgloss.Right).Render(
86 buttons := baseStyle.Width(lipgloss.Width(question)).Align(lipgloss.Right).Render(
86 lipgloss.JoinHorizontal(lipgloss.Center, yesButton, " ", noButton),
87 lipgloss.JoinHorizontal(lipgloss.Center, yesButton, " ", noButton),
@@ -100,9 +101,7 @@ func (q *quitDialogCmp) View() tea.View {
100 Border(lipgloss.RoundedBorder()).
101 Border(lipgloss.RoundedBorder()).
101 BorderForeground(t.BorderFocus)
102 BorderForeground(t.BorderFocus)
104− quitDialogStyle.Render(content),
104+ return quitDialogStyle.Render(content)
108func (q *quitDialogCmp) Position() (int, int) {
107func (q *quitDialogCmp) Position() (int, int) {
internal/tui/components/dialogs/sessions/sessions.go+13−7
@@ -122,23 +122,29 @@ func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
122 return s, nil
122 return s, nil
125−func (s *sessionDialogCmp) View() tea.View {
125+func (s *sessionDialogCmp) View() string {
126 t := styles.CurrentTheme()
126 t := styles.CurrentTheme()
127 listView := s.sessionsList.View()
127 listView := s.sessionsList.View()
128 content := lipgloss.JoinVertical(
128 content := lipgloss.JoinVertical(
129 lipgloss.Left,
129 lipgloss.Left,
130 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Switch Session", s.width-4)),
130 t.S().Base.Padding(0, 1, 1, 1).Render(core.Title("Switch Session", s.width-4)),
131− listView.String(),
131+ listView,
133 t.S().Base.Width(s.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(s.help.View(s.keyMap)),
133 t.S().Base.Width(s.width-2).PaddingLeft(1).AlignHorizontal(lipgloss.Left).Render(s.help.View(s.keyMap)),
136− v := tea.NewView(s.style().Render(content))
136+ return s.style().Render(content)
137− if listView.Cursor() != nil {
137+}
139+func (s *sessionDialogCmp) Cursor() *tea.Cursor {
140+ if cursor, ok := s.sessionsList.(util.Cursor); ok {
141+ cursor := cursor.Cursor()
138− c := s.moveCursor(listView.Cursor())
143+ cursor = s.moveCursor(cursor)
139− v.SetCursor(c)
144+ }
141− return v
147+ return nil
144func (s *sessionDialogCmp) style() lipgloss.Style {
150func (s *sessionDialogCmp) style() lipgloss.Style {
internal/tui/exp/list/list.go+1−1
@@ -84,6 +84,6 @@ func (l *list) Update(tea.Msg) (tea.Model, tea.Cmd) {
86// View implements List.
86// View implements List.
87−func (l *list) View() tea.View {
87+func (l *list) View() string {
88 panic("unimplemented")
88 panic("unimplemented")
internal/tui/page/chat/chat.go+43−43
@@ -54,13 +54,13 @@ const (
54 SideBarWidth = 31 // Width of the sidebar
54 SideBarWidth = 31 // Width of the sidebar
55 SideBarDetailsPadding = 1 // Padding for the sidebar details section
55 SideBarDetailsPadding = 1 // Padding for the sidebar details section
56 HeaderHeight = 1 // Height of the header
56 HeaderHeight = 1 // Height of the header
58 // Layout constants for borders and padding
58 // Layout constants for borders and padding
59 BorderWidth = 1 // Width of component borders
59 BorderWidth = 1 // Width of component borders
60 LeftRightBorders = 2 // Left + right border width (1 + 1)
60 LeftRightBorders = 2 // Left + right border width (1 + 1)
61 TopBottomBorders = 2 // Top + bottom border width (1 + 1)
61 TopBottomBorders = 2 // Top + bottom border width (1 + 1)
62 DetailsPositioning = 2 // Positioning adjustment for details panel
62 DetailsPositioning = 2 // Positioning adjustment for details panel
64 // Timing constants
64 // Timing constants
65 CancelTimerDuration = 2 * time.Second // Duration before cancel timer expires
65 CancelTimerDuration = 2 * time.Second // Duration before cancel timer expires
@@ -81,23 +81,23 @@ type chatPage struct {
81 width, height int
81 width, height int
82 detailsWidth, detailsHeight int
82 detailsWidth, detailsHeight int
83 app *app.App
83 app *app.App
85 // Layout state
85 // Layout state
86 compact bool
86 compact bool
87 forceCompact bool
87 forceCompact bool
88 focusedPane PanelType
88 focusedPane PanelType
90 // Session
90 // Session
91 session session.Session
91 session session.Session
92 keyMap KeyMap
92 keyMap KeyMap
94 // Components
94 // Components
95 header header.Header
95 header header.Header
96 sidebar sidebar.Sidebar
96 sidebar sidebar.Sidebar
97 chat chat.MessageListCmp
97 chat chat.MessageListCmp
98 editor editor.Editor
98 editor editor.Editor
99 splash splash.Splash
99 splash splash.Splash
101 // Simple state flags
101 // Simple state flags
102 showingDetails bool
102 showingDetails bool
103 isCanceling bool
103 isCanceling bool
@@ -123,7 +123,7 @@ func (p *chatPage) Init() tea.Cmd {
123 p.compact = compact
123 p.compact = compact
124 p.forceCompact = compact
124 p.forceCompact = compact
125 p.sidebar.SetCompactMode(p.compact)
125 p.sidebar.SetCompactMode(p.compact)
127 // Set splash state based on config
127 // Set splash state based on config
128 if !config.HasInitialDataConfig() {
128 if !config.HasInitialDataConfig() {
129 // First-time setup: show model selection
129 // First-time setup: show model selection
@@ -138,7 +138,7 @@ func (p *chatPage) Init() tea.Cmd {
138 p.focusedPane = PanelTypeEditor
138 p.focusedPane = PanelTypeEditor
139 p.splashFullScreen = false
139 p.splashFullScreen = false
142 return tea.Batch(
142 return tea.Batch(
143 p.header.Init(),
143 p.header.Init(),
144 p.sidebar.Init(),
144 p.sidebar.Init(),
@@ -244,7 +244,7 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
244 if model.SupportsImages {
244 if model.SupportsImages {
245 return p, util.CmdHandler(OpenFilePickerMsg{})
245 return p, util.CmdHandler(OpenFilePickerMsg{})
247− return p, util.ReportWarn("File attachments are not supported by the current model: " + model.Name)
247+ return p, util.ReportWarn("File attachments are not supported by the current model: " + model.Model)
249 case key.Matches(msg, p.keyMap.Tab):
249 case key.Matches(msg, p.keyMap.Tab):
250 if p.session.ID == "" {
250 if p.session.ID == "" {
@@ -279,10 +279,21 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
279 return p, tea.Batch(cmds...)
279 return p, tea.Batch(cmds...)
282−func (p *chatPage) View() tea.View {
282+func (p *chatPage) Cursor() *tea.Cursor {
283+ switch p.focusedPane {
284+ case PanelTypeEditor:
285+ return p.editor.Cursor()
286+ case PanelTypeSplash:
287+ return p.splash.Cursor()
293+func (p *chatPage) View() string {
283− var chatView tea.View
294+ var chatView string
284 t := styles.CurrentTheme()
295 t := styles.CurrentTheme()
286 if p.session.ID == "" {
297 if p.session.ID == "" {
287 splashView := p.splash.View()
298 splashView := p.splash.View()
288 // Full screen during onboarding or project initialization
299 // Full screen during onboarding or project initialization
@@ -291,49 +302,40 @@ func (p *chatPage) View() tea.View {
292 // Show splash + editor for new message state
303 // Show splash + editor for new message state
293 editorView := p.editor.View()
304 editorView := p.editor.View()
294− chatView = tea.NewView(
295− lipgloss.JoinVertical(
305+ chatView = lipgloss.JoinVertical(
296− lipgloss.Left,
306+ lipgloss.Left,
297− t.S().Base.Render(splashView.String()),
307+ t.S().Base.Render(splashView),
298− editorView.String(),
308+ editorView,
301− chatView.SetCursor(editorView.Cursor())
304 messagesView := p.chat.View()
312 messagesView := p.chat.View()
305 editorView := p.editor.View()
313 editorView := p.editor.View()
306 if p.compact {
314 if p.compact {
307 headerView := p.header.View()
315 headerView := p.header.View()
308− chatView = tea.NewView(
309− lipgloss.JoinVertical(
316+ chatView = lipgloss.JoinVertical(
310− lipgloss.Left,
317+ lipgloss.Left,
311− headerView.String(),
318+ headerView,
312− messagesView.String(),
319+ messagesView,
313− editorView.String(),
320+ editorView,
316− chatView.SetCursor(editorView.Cursor())
318 sidebarView := p.sidebar.View()
323 sidebarView := p.sidebar.View()
319 messages := lipgloss.JoinHorizontal(
324 messages := lipgloss.JoinHorizontal(
320 lipgloss.Left,
325 lipgloss.Left,
321− messagesView.String(),
326+ messagesView,
322− sidebarView.String(),
327+ sidebarView,
324− chatView = tea.NewView(
325− lipgloss.JoinVertical(
329+ chatView = lipgloss.JoinVertical(
326− lipgloss.Left,
330+ lipgloss.Left,
327− messages,
331+ messages,
328− p.editor.View().String(),
332+ p.editor.View(),
331− chatView.SetCursor(editorView.Cursor())
335 layers := []*lipgloss.Layer{
337 layers := []*lipgloss.Layer{
336− lipgloss.NewLayer(chatView.String()).X(0).Y(0),
338+ lipgloss.NewLayer(chatView).X(0).Y(0),
339 if p.showingDetails {
341 if p.showingDetails {
@@ -345,7 +347,7 @@ func (p *chatPage) View() tea.View {
345 details := style.Render(
347 details := style.Render(
346 lipgloss.JoinVertical(
348 lipgloss.JoinVertical(
347 lipgloss.Left,
349 lipgloss.Left,
348− p.sidebar.View().String(),
350+ p.sidebar.View(),
@@ -354,9 +356,7 @@ func (p *chatPage) View() tea.View {
354 canvas := lipgloss.NewCanvas(
356 canvas := lipgloss.NewCanvas(
355 layers...,
357 layers...,
357− view := tea.NewView(canvas.Render())
359+ return canvas.Render()
358− view.SetCursor(chatView.Cursor())
362func (p *chatPage) updateCompactConfig(compact bool) tea.Cmd {
362func (p *chatPage) updateCompactConfig(compact bool) tea.Cmd {
@@ -404,7 +404,7 @@ func (p *chatPage) SetSize(width, height int) tea.Cmd {
404 p.width = width
404 p.width = width
405 p.height = height
405 p.height = height
406 var cmds []tea.Cmd
406 var cmds []tea.Cmd
408 if p.session.ID == "" {
408 if p.session.ID == "" {
409 if p.splashFullScreen {
409 if p.splashFullScreen {
410 cmds = append(cmds, p.splash.SetSize(width, height))
410 cmds = append(cmds, p.splash.SetSize(width, height))
@@ -451,7 +451,7 @@ func (p *chatPage) setSession(session session.Session) tea.Cmd {
452 var cmds []tea.Cmd
452 var cmds []tea.Cmd
453 p.session = session
453 p.session = session
455 cmds = append(cmds, p.SetSize(p.width, p.height))
455 cmds = append(cmds, p.SetSize(p.width, p.height))
456 cmds = append(cmds, p.chat.SetSession(session))
456 cmds = append(cmds, p.chat.SetSession(session))
457 cmds = append(cmds, p.sidebar.SetSession(session))
457 cmds = append(cmds, p.sidebar.SetSession(session))
@@ -64,6 +64,8 @@ func (a appModel) Init() tea.Cmd {
64 cmd = a.status.Init()
64 cmd = a.status.Init()
65 cmds = append(cmds, cmd)
65 cmds = append(cmds, cmd)
67+ cmds = append(cmds, tea.EnableMouseAllMotion)
67 return tea.Batch(cmds...)
69 return tea.Batch(cmds...)
@@ -358,9 +360,9 @@ func (a *appModel) View() tea.View {
358 a.status.SetKeyMap(a.keyMap)
360 a.status.SetKeyMap(a.keyMap)
359 pageView := page.View()
361 pageView := page.View()
360 components := []string{
362 components := []string{
361− pageView.String(),
363+ pageView,
363− components = append(components, a.status.View().String())
365+ components = append(components, a.status.View())
365 appView := lipgloss.JoinVertical(lipgloss.Top, components...)
367 appView := lipgloss.JoinVertical(lipgloss.Top, components...)
366 layers := []*lipgloss.Layer{
368 layers := []*lipgloss.Layer{
@@ -373,14 +375,20 @@ func (a *appModel) View() tea.View {
376− cursor := pageView.Cursor()
378+ var cursor *tea.Cursor
379+ if v, ok := page.(util.Cursor); ok {
377− activeView := a.dialog.ActiveView()
382+ activeView := a.dialog.ActiveModel()
378 if activeView != nil {
383 if activeView != nil {
384+ cursor = nil // Reset cursor if a dialog is active unless it implements util.Cursor
379− cursor = activeView.Cursor()
385+ if v, ok := activeView.(util.Cursor); ok {
382 if a.completions.Open() && cursor != nil {
390 if a.completions.Open() && cursor != nil {
383− cmp := a.completions.View().String()
391+ cmp := a.completions.View()
384 x, y := a.completions.Position()
392 x, y := a.completions.Position()
385 layers = append(
393 layers = append(
@@ -392,10 +400,11 @@ func (a *appModel) View() tea.View {
392 layers...,
400 layers...,
395 t := styles.CurrentTheme()
404 t := styles.CurrentTheme()
396− view := tea.NewView(canvas.Render())
405+ view.Layer = canvas
397− view.SetBackgroundColor(t.BgBase)
406+ view.BackgroundColor = t.BgBase
398− view.SetCursor(cursor)
407+ view.Cursor = cursor
399 return view
408 return view
internal/tui/util/util.go+5−1
@@ -6,9 +6,13 @@ import (
6 tea "github.com/charmbracelet/bubbletea/v2"
6 tea "github.com/charmbracelet/bubbletea/v2"
9+type Cursor interface {
9type Model interface {
13type Model interface {
11− tea.Viewable
15+ tea.ViewModel
14func CmdHandler(msg tea.Msg) tea.Cmd {
18func CmdHandler(msg tea.Msg) tea.Cmd {
vendor/cloud.google.com/go/LICENSEnew file+202
@@ -0,0 +1,202 @@
3+ Version 2.0, January 2004
4+ http://www.apache.org/licenses/
6+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10+ "License" shall mean the terms and conditions for use, reproduction,
11+ and distribution as defined by Sections 1 through 9 of this document.
13+ "Licensor" shall mean the copyright owner or entity authorized by
14+ the copyright owner that is granting the License.
16+ "Legal Entity" shall mean the union of the acting entity and all
17+ other entities that control, are controlled by, or are under common
18+ control with that entity. For the purposes of this definition,
19+ "control" means (i) the power, direct or indirect, to cause the
20+ direction or management of such entity, whether by contract or
21+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22+ outstanding shares, or (iii) beneficial ownership of such entity.
24+ "You" (or "Your") shall mean an individual or Legal Entity
25+ exercising permissions granted by this License.
27+ "Source" form shall mean the preferred form for making modifications,
28+ including but not limited to software source code, documentation
29+ source, and configuration files.
31+ "Object" form shall mean any form resulting from mechanical
32+ transformation or translation of a Source form, including but
33+ not limited to compiled object code, generated documentation,
34+ and conversions to other media types.
36+ "Work" shall mean the work of authorship, whether in Source or
37+ Object form, made available under the License, as indicated by a
38+ copyright notice that is included in or attached to the work
39+ (an example is provided in the Appendix below).
41+ "Derivative Works" shall mean any work, whether in Source or Object
42+ form, that is based on (or derived from) the Work and for which the
43+ editorial revisions, annotations, elaborations, or other modifications
44+ represent, as a whole, an original work of authorship. For the purposes
45+ of this License, Derivative Works shall not include works that remain
46+ separable from, or merely link (or bind by name) to the interfaces of,
47+ the Work and Derivative Works thereof.
49+ "Contribution" shall mean any work of authorship, including
50+ the original version of the Work and any modifications or additions
51+ to that Work or Derivative Works thereof, that is intentionally
52+ submitted to Licensor for inclusion in the Work by the copyright owner
53+ or by an individual or Legal Entity authorized to submit on behalf of
54+ the copyright owner. For the purposes of this definition, "submitted"
55+ means any form of electronic, verbal, or written communication sent
56+ to the Licensor or its representatives, including but not limited to
57+ communication on electronic mailing lists, source code control systems,
58+ and issue tracking systems that are managed by, or on behalf of, the
59+ Licensor for the purpose of discussing and improving the Work, but
60+ excluding communication that is conspicuously marked or otherwise
61+ designated in writing by the copyright owner as "Not a Contribution."
63+ "Contributor" shall mean Licensor and any individual or Legal Entity
64+ on behalf of whom a Contribution has been received by Licensor and
65+ subsequently incorporated within the Work.
67+ 2. Grant of Copyright License. Subject to the terms and conditions of
68+ this License, each Contributor hereby grants to You a perpetual,
69+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70+ copyright license to reproduce, prepare Derivative Works of,
71+ publicly display, publicly perform, sublicense, and distribute the
72+ Work and such Derivative Works in Source or Object form.
74+ 3. Grant of Patent License. Subject to the terms and conditions of
75+ this License, each Contributor hereby grants to You a perpetual,
76+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77+ (except as stated in this section) patent license to make, have made,
78+ use, offer to sell, sell, import, and otherwise transfer the Work,
79+ where such license applies only to those patent claims licensable
80+ by such Contributor that are necessarily infringed by their
81+ Contribution(s) alone or by combination of their Contribution(s)
82+ with the Work to which such Contribution(s) was submitted. If You
83+ institute patent litigation against any entity (including a
84+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85+ or a Contribution incorporated within the Work constitutes direct
86+ or contributory patent infringement, then any patent licenses
87+ granted to You under this License for that Work shall terminate
88+ as of the date such litigation is filed.
90+ 4. Redistribution. You may reproduce and distribute copies of the
91+ Work or Derivative Works thereof in any medium, with or without
92+ modifications, and in Source or Object form, provided that You
93+ meet the following conditions:
95+ (a) You must give any other recipients of the Work or
96+ Derivative Works a copy of this License; and
98+ (b) You must cause any modified files to carry prominent notices
99+ stating that You changed the files; and
101+ (c) You must retain, in the Source form of any Derivative Works
102+ that You distribute, all copyright, patent, trademark, and
103+ attribution notices from the Source form of the Work,
104+ excluding those notices that do not pertain to any part of
105+ the Derivative Works; and
107+ (d) If the Work includes a "NOTICE" text file as part of its
108+ distribution, then any Derivative Works that You distribute must
109+ include a readable copy of the attribution notices contained
110+ within such NOTICE file, excluding those notices that do not
111+ pertain to any part of the Derivative Works, in at least one
112+ of the following places: within a NOTICE text file distributed
113+ as part of the Derivative Works; within the Source form or
114+ documentation, if provided along with the Derivative Works; or,
115+ within a display generated by the Derivative Works, if and
116+ wherever such third-party notices normally appear. The contents
117+ of the NOTICE file are for informational purposes only and
118+ do not modify the License. You may add Your own attribution
119+ notices within Derivative Works that You distribute, alongside
120+ or as an addendum to the NOTICE text from the Work, provided
121+ that such additional attribution notices cannot be construed
122+ as modifying the License.
124+ You may add Your own copyright statement to Your modifications and
125+ may provide additional or different license terms and conditions
126+ for use, reproduction, or distribution of Your modifications, or
127+ for any such Derivative Works as a whole, provided Your use,
128+ reproduction, and distribution of the Work otherwise complies with
129+ the conditions stated in this License.
131+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132+ any Contribution intentionally submitted for inclusion in the Work
133+ by You to the Licensor shall be under the terms and conditions of
134+ this License, without any additional terms or conditions.
135+ Notwithstanding the above, nothing herein shall supersede or modify
136+ the terms of any separate license agreement you may have executed
137+ with Licensor regarding such Contributions.
139+ 6. Trademarks. This License does not grant permission to use the trade
140+ names, trademarks, service marks, or product names of the Licensor,
141+ except as required for reasonable and customary use in describing the
142+ origin of the Work and reproducing the content of the NOTICE file.
144+ 7. Disclaimer of Warranty. Unless required by applicable law or
145+ agreed to in writing, Licensor provides the Work (and each
146+ Contributor provides its Contributions) on an "AS IS" BASIS,
147+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148+ implied, including, without limitation, any warranties or conditions
149+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150+ PARTICULAR PURPOSE. You are solely responsible for determining the
151+ appropriateness of using or redistributing the Work and assume any
152+ risks associated with Your exercise of permissions under this License.
154+ 8. Limitation of Liability. In no event and under no legal theory,
155+ whether in tort (including negligence), contract, or otherwise,
156+ unless required by applicable law (such as deliberate and grossly
157+ negligent acts) or agreed to in writing, shall any Contributor be
158+ liable to You for damages, including any direct, indirect, special,
159+ incidental, or consequential damages of any character arising as a
160+ result of this License or out of the use or inability to use the
161+ Work (including but not limited to damages for loss of goodwill,
162+ work stoppage, computer failure or malfunction, or any and all
163+ other commercial damages or losses), even if such Contributor
164+ has been advised of the possibility of such damages.
166+ 9. Accepting Warranty or Additional Liability. While redistributing
167+ the Work or Derivative Works thereof, You may choose to offer,
168+ and charge a fee for, acceptance of support, warranty, indemnity,
169+ or other liability obligations and/or rights consistent with this
170+ License. However, in accepting such obligations, You may act only
171+ on Your own behalf and on Your sole responsibility, not on behalf
172+ of any other Contributor, and only if You agree to indemnify,
173+ defend, and hold each Contributor harmless for any liability
174+ incurred by, or claims asserted against, such Contributor by reason
175+ of your accepting any such warranty or additional liability.
177+ END OF TERMS AND CONDITIONS
179+ APPENDIX: How to apply the Apache License to your work.
181+ To apply the Apache License to your work, attach the following
182+ boilerplate notice, with the fields enclosed by brackets "[]"
183+ replaced with your own identifying information. (Don't include
184+ the brackets!) The text should be enclosed in the appropriate
185+ comment syntax for the file format. We also recommend that a
186+ file or class name and description of purpose be included on the
187+ same "printed page" as the copyright notice for easier
188+ identification within third-party archives.
190+ Copyright [yyyy] [name of copyright owner]
192+ Licensed under the Apache License, Version 2.0 (the "License");
193+ you may not use this file except in compliance with the License.
194+ You may obtain a copy of the License at
196+ http://www.apache.org/licenses/LICENSE-2.0
198+ Unless required by applicable law or agreed to in writing, software
199+ distributed under the License is distributed on an "AS IS" BASIS,
200+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201+ See the License for the specific language governing permissions and
202+ limitations under the License.
vendor/cloud.google.com/go/auth/CHANGES.mdnew file+368
@@ -0,0 +1,368 @@
3+## [0.13.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.12.1...auth/v0.13.0) (2024-12-13)
8+* **auth:** Add logging support ([#11079](https://github.com/googleapis/google-cloud-go/issues/11079)) ([c80e31d](https://github.com/googleapis/google-cloud-go/commit/c80e31df5ecb33a810be3dfb9d9e27ac531aa91d))
9+* **auth:** Pass logger from auth layer to metadata package ([#11288](https://github.com/googleapis/google-cloud-go/issues/11288)) ([b552efd](https://github.com/googleapis/google-cloud-go/commit/b552efd6ab34e5dfded18438e0fbfd925805614f))
14+* **auth:** Check compute cred type before non-default flag for DP ([#11255](https://github.com/googleapis/google-cloud-go/issues/11255)) ([4347ca1](https://github.com/googleapis/google-cloud-go/commit/4347ca141892be8ae813399b4b437662a103bc90))
16+## [0.12.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.12.0...auth/v0.12.1) (2024-12-10)
21+* **auth:** Correct typo in link ([#11160](https://github.com/googleapis/google-cloud-go/issues/11160)) ([af6fb46](https://github.com/googleapis/google-cloud-go/commit/af6fb46d7cd694ddbe8c9d63bc4cdcd62b9fb2c1))
23+## [0.12.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.11.0...auth/v0.12.0) (2024-12-04)
28+* **auth:** Add support for providing custom certificate URL ([#11006](https://github.com/googleapis/google-cloud-go/issues/11006)) ([ebf3657](https://github.com/googleapis/google-cloud-go/commit/ebf36579724afb375d3974cf1da38f703e3b7dbc)), refs [#11005](https://github.com/googleapis/google-cloud-go/issues/11005)
33+* **auth:** Ensure endpoints are present in Validator ([#11209](https://github.com/googleapis/google-cloud-go/issues/11209)) ([106cd53](https://github.com/googleapis/google-cloud-go/commit/106cd53309facaef1b8ea78376179f523f6912b9)), refs [#11006](https://github.com/googleapis/google-cloud-go/issues/11006) [#11190](https://github.com/googleapis/google-cloud-go/issues/11190) [#11189](https://github.com/googleapis/google-cloud-go/issues/11189) [#11188](https://github.com/googleapis/google-cloud-go/issues/11188)
35+## [0.11.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.2...auth/v0.11.0) (2024-11-21)
40+* **auth:** Add universe domain support to mTLS ([#11159](https://github.com/googleapis/google-cloud-go/issues/11159)) ([117748b](https://github.com/googleapis/google-cloud-go/commit/117748ba1cfd4ae62a6a4feb7e30951cb2bc9344))
42+## [0.10.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.1...auth/v0.10.2) (2024-11-12)
47+* **auth:** Restore use of grpc.Dial ([#11118](https://github.com/googleapis/google-cloud-go/issues/11118)) ([2456b94](https://github.com/googleapis/google-cloud-go/commit/2456b943b7b8aaabd4d8bfb7572c0f477ae0db45)), refs [#7556](https://github.com/googleapis/google-cloud-go/issues/7556)
49+## [0.10.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.0...auth/v0.10.1) (2024-11-06)
54+* **auth:** Restore Application Default Credentials support to idtoken ([#11083](https://github.com/googleapis/google-cloud-go/issues/11083)) ([8771f2e](https://github.com/googleapis/google-cloud-go/commit/8771f2ea9807ab822083808e0678392edff3b4f2))
55+* **auth:** Skip impersonate universe domain check if empty ([#11086](https://github.com/googleapis/google-cloud-go/issues/11086)) ([87159c1](https://github.com/googleapis/google-cloud-go/commit/87159c1059d4a18d1367ce62746a838a94964ab6))
57+## [0.10.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.9...auth/v0.10.0) (2024-10-30)
62+* **auth:** Add universe domain support to credentials/impersonate ([#10953](https://github.com/googleapis/google-cloud-go/issues/10953)) ([e06cb64](https://github.com/googleapis/google-cloud-go/commit/e06cb6499f7eda3aef08ab18ff197016f667684b))
64+## [0.9.9](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.8...auth/v0.9.9) (2024-10-22)
69+* **auth:** Fallback cert lookups for missing files ([#11013](https://github.com/googleapis/google-cloud-go/issues/11013)) ([bd76695](https://github.com/googleapis/google-cloud-go/commit/bd766957ec238b7c40ddbabb369e612dc9b07313)), refs [#10844](https://github.com/googleapis/google-cloud-go/issues/10844)
70+* **auth:** Replace MDS endpoint universe_domain with universe-domain ([#11000](https://github.com/googleapis/google-cloud-go/issues/11000)) ([6a1586f](https://github.com/googleapis/google-cloud-go/commit/6a1586f2ce9974684affaea84e7b629313b4d114))
72+## [0.9.8](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.7...auth/v0.9.8) (2024-10-09)
77+* **auth:** Restore OpenTelemetry handling in transports ([#10968](https://github.com/googleapis/google-cloud-go/issues/10968)) ([08c6d04](https://github.com/googleapis/google-cloud-go/commit/08c6d04901c1a20e219b2d86df41dbaa6d7d7b55)), refs [#10962](https://github.com/googleapis/google-cloud-go/issues/10962)
78+* **auth:** Try talk to plaintext S2A if credentials can not be found for mTLS-S2A ([#10941](https://github.com/googleapis/google-cloud-go/issues/10941)) ([0f0bf2d](https://github.com/googleapis/google-cloud-go/commit/0f0bf2d18c97dd8b65bcf0099f0802b5631c6287))
80+## [0.9.7](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.6...auth/v0.9.7) (2024-10-01)
85+* **auth:** Restore support for non-default service accounts for DirectPath ([#10937](https://github.com/googleapis/google-cloud-go/issues/10937)) ([a38650e](https://github.com/googleapis/google-cloud-go/commit/a38650edbf420223077498cafa537aec74b37aad)), refs [#10907](https://github.com/googleapis/google-cloud-go/issues/10907)
87+## [0.9.6](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.5...auth/v0.9.6) (2024-09-30)
92+* **auth:** Make aws credentials provider retrieve fresh credentials ([#10920](https://github.com/googleapis/google-cloud-go/issues/10920)) ([250fbf8](https://github.com/googleapis/google-cloud-go/commit/250fbf87d858d865e399a241b7e537c4ff0c3dd8))
94+## [0.9.5](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.4...auth/v0.9.5) (2024-09-25)
99+* **auth:** Restore support for GOOGLE_CLOUD_UNIVERSE_DOMAIN env ([#10915](https://github.com/googleapis/google-cloud-go/issues/10915)) ([94caaaa](https://github.com/googleapis/google-cloud-go/commit/94caaaa061362d0e00ef6214afcc8a0a3e7ebfb2))
100+* **auth:** Skip directpath credentials overwrite when it's not on GCE ([#10833](https://github.com/googleapis/google-cloud-go/issues/10833)) ([7e5e8d1](https://github.com/googleapis/google-cloud-go/commit/7e5e8d10b761b0a6e43e19a028528db361bc07b1))
101+* **auth:** Use new context for non-blocking token refresh ([#10919](https://github.com/googleapis/google-cloud-go/issues/10919)) ([cf7102d](https://github.com/googleapis/google-cloud-go/commit/cf7102d33a21be1e5a9d47a49456b3a57c43b350))
103+## [0.9.4](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.3...auth/v0.9.4) (2024-09-11)
108+* **auth:** Enable self-signed JWT for non-GDU universe domain ([#10831](https://github.com/googleapis/google-cloud-go/issues/10831)) ([f9869f7](https://github.com/googleapis/google-cloud-go/commit/f9869f7903cfd34d1b97c25d0dc5669d2c5138e6))
110+## [0.9.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.2...auth/v0.9.3) (2024-09-03)
115+* **auth:** Choose quota project envvar over file when both present ([#10807](https://github.com/googleapis/google-cloud-go/issues/10807)) ([2d8dd77](https://github.com/googleapis/google-cloud-go/commit/2d8dd7700eff92d4b95027be55e26e1e7aa79181)), refs [#10804](https://github.com/googleapis/google-cloud-go/issues/10804)
117+## [0.9.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.1...auth/v0.9.2) (2024-08-30)
122+* **auth:** Handle non-Transport DefaultTransport ([#10733](https://github.com/googleapis/google-cloud-go/issues/10733)) ([98d91dc](https://github.com/googleapis/google-cloud-go/commit/98d91dc8316b247498fab41ab35e57a0446fe556)), refs [#10742](https://github.com/googleapis/google-cloud-go/issues/10742)
123+* **auth:** Make sure quota option takes precedence over env/file ([#10797](https://github.com/googleapis/google-cloud-go/issues/10797)) ([f1b050d](https://github.com/googleapis/google-cloud-go/commit/f1b050d56d804b245cab048c2980d32b0eaceb4e)), refs [#10795](https://github.com/googleapis/google-cloud-go/issues/10795)
128+* **auth:** Fix Go doc comment link ([#10751](https://github.com/googleapis/google-cloud-go/issues/10751)) ([015acfa](https://github.com/googleapis/google-cloud-go/commit/015acfab4d172650928bb1119bc2cd6307b9a437))
130+## [0.9.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.0...auth/v0.9.1) (2024-08-22)
135+* **auth:** Setting expireEarly to default when the value is 0 ([#10732](https://github.com/googleapis/google-cloud-go/issues/10732)) ([5e67869](https://github.com/googleapis/google-cloud-go/commit/5e67869a31e9e8ecb4eeebd2cfa11a761c3b1948))
137+## [0.9.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.8.1...auth/v0.9.0) (2024-08-16)
142+* **auth:** Auth library can talk to S2A over mTLS ([#10634](https://github.com/googleapis/google-cloud-go/issues/10634)) ([5250a13](https://github.com/googleapis/google-cloud-go/commit/5250a13ec95b8d4eefbe0158f82857ff2189cb45))
144+## [0.8.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.8.0...auth/v0.8.1) (2024-08-13)
149+* **auth:** Make default client creation more lenient ([#10669](https://github.com/googleapis/google-cloud-go/issues/10669)) ([1afb9ee](https://github.com/googleapis/google-cloud-go/commit/1afb9ee1ee9de9810722800018133304a0ca34d1)), refs [#10638](https://github.com/googleapis/google-cloud-go/issues/10638)
151+## [0.8.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.3...auth/v0.8.0) (2024-08-07)
156+* **auth:** Adds support for X509 workload identity federation ([#10373](https://github.com/googleapis/google-cloud-go/issues/10373)) ([5d07505](https://github.com/googleapis/google-cloud-go/commit/5d075056cbe27bb1da4072a26070c41f8999eb9b))
158+## [0.7.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.2...auth/v0.7.3) (2024-08-01)
163+* **auth/oauth2adapt:** Update dependencies ([257c40b](https://github.com/googleapis/google-cloud-go/commit/257c40bd6d7e59730017cf32bda8823d7a232758))
164+* **auth:** Disable automatic universe domain check for MDS ([#10620](https://github.com/googleapis/google-cloud-go/issues/10620)) ([7cea5ed](https://github.com/googleapis/google-cloud-go/commit/7cea5edd5a0c1e6bca558696f5607879141910e8))
165+* **auth:** Update dependencies ([257c40b](https://github.com/googleapis/google-cloud-go/commit/257c40bd6d7e59730017cf32bda8823d7a232758))
167+## [0.7.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.1...auth/v0.7.2) (2024-07-22)
172+* **auth:** Use default client for universe metadata lookup ([#10551](https://github.com/googleapis/google-cloud-go/issues/10551)) ([d9046fd](https://github.com/googleapis/google-cloud-go/commit/d9046fdd1435d1ce48f374806c1def4cb5ac6cd3)), refs [#10544](https://github.com/googleapis/google-cloud-go/issues/10544)
174+## [0.7.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.7.0...auth/v0.7.1) (2024-07-10)
179+* **auth:** Bump google.golang.org/grpc@v1.64.1 ([8ecc4e9](https://github.com/googleapis/google-cloud-go/commit/8ecc4e9622e5bbe9b90384d5848ab816027226c5))
181+## [0.7.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.1...auth/v0.7.0) (2024-07-09)
186+* **auth:** Add workload X509 cert provider as a default cert provider ([#10479](https://github.com/googleapis/google-cloud-go/issues/10479)) ([c51ee6c](https://github.com/googleapis/google-cloud-go/commit/c51ee6cf65ce05b4d501083e49d468c75ac1ea63))
191+* **auth/oauth2adapt:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
192+* **auth:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
193+* **auth:** Check len of slices, not non-nil ([#10483](https://github.com/googleapis/google-cloud-go/issues/10483)) ([0a966a1](https://github.com/googleapis/google-cloud-go/commit/0a966a183e5f0e811977216d736d875b7233e942))
195+## [0.6.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.0...auth/v0.6.1) (2024-07-01)
200+* **auth:** Support gRPC API keys ([#10460](https://github.com/googleapis/google-cloud-go/issues/10460)) ([daa6646](https://github.com/googleapis/google-cloud-go/commit/daa6646d2af5d7fb5b30489f4934c7db89868c7c))
201+* **auth:** Update http and grpc transports to support token exchange over mTLS ([#10397](https://github.com/googleapis/google-cloud-go/issues/10397)) ([c6dfdcf](https://github.com/googleapis/google-cloud-go/commit/c6dfdcf893c3f971eba15026c12db0a960ae81f2))
203+## [0.6.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.2...auth/v0.6.0) (2024-06-25)
208+* **auth:** Add non-blocking token refresh for compute MDS ([#10263](https://github.com/googleapis/google-cloud-go/issues/10263)) ([9ac350d](https://github.com/googleapis/google-cloud-go/commit/9ac350da11a49b8e2174d3fc5b1a5070fec78b4e))
213+* **auth:** Return error if envvar detected file returns an error ([#10431](https://github.com/googleapis/google-cloud-go/issues/10431)) ([e52b9a7](https://github.com/googleapis/google-cloud-go/commit/e52b9a7c45468827f5d220ab00965191faeb9d05))
215+## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.1...auth/v0.5.2) (2024-06-24)
220+* **auth:** Fetch initial token when CachedTokenProviderOptions.DisableAutoRefresh is true ([#10415](https://github.com/googleapis/google-cloud-go/issues/10415)) ([3266763](https://github.com/googleapis/google-cloud-go/commit/32667635ca2efad05cd8c087c004ca07d7406913)), refs [#10414](https://github.com/googleapis/google-cloud-go/issues/10414)
222+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.0...auth/v0.5.1) (2024-05-31)
227+* **auth:** Pass through client to 2LO and 3LO flows ([#10290](https://github.com/googleapis/google-cloud-go/issues/10290)) ([685784e](https://github.com/googleapis/google-cloud-go/commit/685784ea84358c15e9214bdecb307d37aa3b6d2f))
229+## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.2...auth/v0.5.0) (2024-05-28)
234+* **auth:** Adds X509 workload certificate provider ([#10233](https://github.com/googleapis/google-cloud-go/issues/10233)) ([17a9db7](https://github.com/googleapis/google-cloud-go/commit/17a9db73af35e3d1a7a25ac4fd1377a103de6150))
236+## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.1...auth/v0.4.2) (2024-05-16)
241+* **auth:** Enable client certificates by default only for GDU ([#10151](https://github.com/googleapis/google-cloud-go/issues/10151)) ([7c52978](https://github.com/googleapis/google-cloud-go/commit/7c529786275a39b7e00525f7d5e7be0d963e9e15))
242+* **auth:** Handle non-Transport DefaultTransport ([#10162](https://github.com/googleapis/google-cloud-go/issues/10162)) ([fa3bfdb](https://github.com/googleapis/google-cloud-go/commit/fa3bfdb23aaa45b34394a8b61e753b3587506782)), refs [#10159](https://github.com/googleapis/google-cloud-go/issues/10159)
243+* **auth:** Have refresh time match docs ([#10147](https://github.com/googleapis/google-cloud-go/issues/10147)) ([bcb5568](https://github.com/googleapis/google-cloud-go/commit/bcb5568c07a54dd3d2e869d15f502b0741a609e8))
244+* **auth:** Update compute token fetching error with named prefix ([#10180](https://github.com/googleapis/google-cloud-go/issues/10180)) ([4573504](https://github.com/googleapis/google-cloud-go/commit/4573504828d2928bebedc875d87650ba227829ea))
246+## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.0...auth/v0.4.1) (2024-05-09)
251+* **auth:** Don't try to detect default creds it opt configured ([#10143](https://github.com/googleapis/google-cloud-go/issues/10143)) ([804632e](https://github.com/googleapis/google-cloud-go/commit/804632e7c5b0b85ff522f7951114485e256eb5bc))
253+## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.3.0...auth/v0.4.0) (2024-05-07)
258+* **auth:** Enable client certificates by default ([#10102](https://github.com/googleapis/google-cloud-go/issues/10102)) ([9013e52](https://github.com/googleapis/google-cloud-go/commit/9013e5200a6ec0f178ed91acb255481ffb073a2c))
263+* **auth:** Get s2a logic up to date ([#10093](https://github.com/googleapis/google-cloud-go/issues/10093)) ([4fe9ae4](https://github.com/googleapis/google-cloud-go/commit/4fe9ae4b7101af2a5221d6d6b2e77b479305bb06))
265+## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.2...auth/v0.3.0) (2024-04-23)
270+* **auth/httptransport:** Add ability to customize transport ([#10023](https://github.com/googleapis/google-cloud-go/issues/10023)) ([72c7f6b](https://github.com/googleapis/google-cloud-go/commit/72c7f6bbec3136cc7a62788fc7186bc33ef6c3b3)), refs [#9812](https://github.com/googleapis/google-cloud-go/issues/9812) [#9814](https://github.com/googleapis/google-cloud-go/issues/9814)
275+* **auth/credentials:** Error on bad file name if explicitly set ([#10018](https://github.com/googleapis/google-cloud-go/issues/10018)) ([55beaa9](https://github.com/googleapis/google-cloud-go/commit/55beaa993aaf052d8be39766afc6777c3c2a0bdd)), refs [#9809](https://github.com/googleapis/google-cloud-go/issues/9809)
277+## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.1...auth/v0.2.2) (2024-04-19)
282+* **auth:** Add internal opt to skip validation on transports ([#9999](https://github.com/googleapis/google-cloud-go/issues/9999)) ([9e20ef8](https://github.com/googleapis/google-cloud-go/commit/9e20ef89f6287d6bd03b8697d5898dc43b4a77cf)), refs [#9823](https://github.com/googleapis/google-cloud-go/issues/9823)
283+* **auth:** Set secure flag for gRPC conn pools ([#10002](https://github.com/googleapis/google-cloud-go/issues/10002)) ([14e3956](https://github.com/googleapis/google-cloud-go/commit/14e3956dfd736399731b5ee8d9b178ae085cf7ba)), refs [#9833](https://github.com/googleapis/google-cloud-go/issues/9833)
285+## [0.2.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.2.0...auth/v0.2.1) (2024-04-18)
290+* **auth:** Default gRPC token type to Bearer if not set ([#9800](https://github.com/googleapis/google-cloud-go/issues/9800)) ([5284066](https://github.com/googleapis/google-cloud-go/commit/5284066670b6fe65d79089cfe0199c9660f87fc7))
292+## [0.2.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.1...auth/v0.2.0) (2024-04-15)
296+In the below mentioned commits there were a few large breaking changes since the
297+last release of the module.
299+1. The `Credentials` type has been moved to the root of the module as it is
300+ becoming the core abstraction for the whole module.
301+2. Because of the above mentioned change many functions that previously
302+ returned a `TokenProvider` now return `Credentials`. Similarly, these
303+ functions have been renamed to be more specific.
304+3. Most places that used to take an optional `TokenProvider` now accept
305+ `Credentials`. You can make a `Credentials` from a `TokenProvider` using the
306+ constructor found in the `auth` package.
307+4. The `detect` package has been renamed to `credentials`. With this change some
308+ function signatures were also updated for better readability.
309+5. Derivative auth flows like `impersonate` and `downscope` have been moved to
310+ be under the new `credentials` package.
312+Although these changes are disruptive we think that they are for the best of the
313+long-term health of the module. We do not expect any more large breaking changes
314+like these in future revisions, even before 1.0.0. This version will be the
315+first version of the auth library that our client libraries start to use and
320+* **auth/credentials/externalaccount:** Add default TokenURL ([#9700](https://github.com/googleapis/google-cloud-go/issues/9700)) ([81830e6](https://github.com/googleapis/google-cloud-go/commit/81830e6848ceefd055aa4d08f933d1154455a0f6))
321+* **auth:** Add downscope.Options.UniverseDomain ([#9634](https://github.com/googleapis/google-cloud-go/issues/9634)) ([52cf7d7](https://github.com/googleapis/google-cloud-go/commit/52cf7d780853594291c4e34302d618299d1f5a1d))
322+* **auth:** Add universe domain to grpctransport and httptransport ([#9663](https://github.com/googleapis/google-cloud-go/issues/9663)) ([67d353b](https://github.com/googleapis/google-cloud-go/commit/67d353beefe3b607c08c891876fbd95ab89e5fe3)), refs [#9670](https://github.com/googleapis/google-cloud-go/issues/9670)
323+* **auth:** Add UniverseDomain to DetectOptions ([#9536](https://github.com/googleapis/google-cloud-go/issues/9536)) ([3618d3f](https://github.com/googleapis/google-cloud-go/commit/3618d3f7061615c0e189f376c75abc201203b501))
324+* **auth:** Make package externalaccount public ([#9633](https://github.com/googleapis/google-cloud-go/issues/9633)) ([a0978d8](https://github.com/googleapis/google-cloud-go/commit/a0978d8e96968399940ebd7d092539772bf9caac))
325+* **auth:** Move credentials to base auth package ([#9590](https://github.com/googleapis/google-cloud-go/issues/9590)) ([1a04baf](https://github.com/googleapis/google-cloud-go/commit/1a04bafa83c27342b9308d785645e1e5423ea10d))
326+* **auth:** Refactor public sigs to use Credentials ([#9603](https://github.com/googleapis/google-cloud-go/issues/9603)) ([69cb240](https://github.com/googleapis/google-cloud-go/commit/69cb240c530b1f7173a9af2555c19e9a1beb56c5))
331+* **auth/oauth2adapt:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a))
332+* **auth:** Fix uint32 conversion ([9221c7f](https://github.com/googleapis/google-cloud-go/commit/9221c7fa12cef9d5fb7ddc92f41f1d6204971c7b))
333+* **auth:** Port sts expires fix ([#9618](https://github.com/googleapis/google-cloud-go/issues/9618)) ([7bec97b](https://github.com/googleapis/google-cloud-go/commit/7bec97b2f51ed3ac4f9b88bf100d301da3f5d1bd))
334+* **auth:** Read universe_domain from all credentials files ([#9632](https://github.com/googleapis/google-cloud-go/issues/9632)) ([16efbb5](https://github.com/googleapis/google-cloud-go/commit/16efbb52e39ea4a319e5ee1e95c0e0305b6d9824))
335+* **auth:** Remove content-type header from idms get requests ([#9508](https://github.com/googleapis/google-cloud-go/issues/9508)) ([8589f41](https://github.com/googleapis/google-cloud-go/commit/8589f41599d265d7c3d46a3d86c9fab2329cbdd9))
336+* **auth:** Update protobuf dep to v1.33.0 ([30b038d](https://github.com/googleapis/google-cloud-go/commit/30b038d8cac0b8cd5dd4761c87f3f298760dd33a))
338+## [0.1.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.1.0...auth/v0.1.1) (2024-03-10)
343+* **auth/impersonate:** Properly send default detect params ([#9529](https://github.com/googleapis/google-cloud-go/issues/9529)) ([5b6b8be](https://github.com/googleapis/google-cloud-go/commit/5b6b8bef577f82707e51f5cc5d258d5bdf90218f)), refs [#9136](https://github.com/googleapis/google-cloud-go/issues/9136)
344+* **auth:** Update grpc-go to v1.56.3 ([343cea8](https://github.com/googleapis/google-cloud-go/commit/343cea8c43b1e31ae21ad50ad31d3b0b60143f8c))
345+* **auth:** Update grpc-go to v1.59.0 ([81a97b0](https://github.com/googleapis/google-cloud-go/commit/81a97b06cb28b25432e4ece595c55a9857e960b7))
347+## 0.1.0 (2023-10-18)
352+* **auth:** Add base auth package ([#8465](https://github.com/googleapis/google-cloud-go/issues/8465)) ([6a45f26](https://github.com/googleapis/google-cloud-go/commit/6a45f26b809b64edae21f312c18d4205f96b180e))
353+* **auth:** Add cert support to httptransport ([#8569](https://github.com/googleapis/google-cloud-go/issues/8569)) ([37e3435](https://github.com/googleapis/google-cloud-go/commit/37e3435f8e98595eafab481bdfcb31a4c56fa993))
354+* **auth:** Add Credentials.UniverseDomain() ([#8654](https://github.com/googleapis/google-cloud-go/issues/8654)) ([af0aa1e](https://github.com/googleapis/google-cloud-go/commit/af0aa1ed8015bc8fe0dd87a7549ae029107cbdb8))
355+* **auth:** Add detect package ([#8491](https://github.com/googleapis/google-cloud-go/issues/8491)) ([d977419](https://github.com/googleapis/google-cloud-go/commit/d977419a3269f6acc193df77a2136a6eb4b4add7))
356+* **auth:** Add downscope package ([#8532](https://github.com/googleapis/google-cloud-go/issues/8532)) ([dda9bff](https://github.com/googleapis/google-cloud-go/commit/dda9bff8ec70e6d104901b4105d13dcaa4e2404c))
357+* **auth:** Add grpctransport package ([#8625](https://github.com/googleapis/google-cloud-go/issues/8625)) ([69a8347](https://github.com/googleapis/google-cloud-go/commit/69a83470bdcc7ed10c6c36d1abc3b7cfdb8a0ee5))
358+* **auth:** Add httptransport package ([#8567](https://github.com/googleapis/google-cloud-go/issues/8567)) ([6898597](https://github.com/googleapis/google-cloud-go/commit/6898597d2ea95d630fcd00fd15c58c75ea843bff))
359+* **auth:** Add idtoken package ([#8580](https://github.com/googleapis/google-cloud-go/issues/8580)) ([a79e693](https://github.com/googleapis/google-cloud-go/commit/a79e693e97e4e3e1c6742099af3dbc58866d88fe))
360+* **auth:** Add impersonate package ([#8578](https://github.com/googleapis/google-cloud-go/issues/8578)) ([e29ba0c](https://github.com/googleapis/google-cloud-go/commit/e29ba0cb7bd3888ab9e808087027dc5a32474c04))
361+* **auth:** Add support for external accounts in detect ([#8508](https://github.com/googleapis/google-cloud-go/issues/8508)) ([62210d5](https://github.com/googleapis/google-cloud-go/commit/62210d5d3e56e8e9f35db8e6ac0defec19582507))
362+* **auth:** Port external account changes ([#8697](https://github.com/googleapis/google-cloud-go/issues/8697)) ([5823db5](https://github.com/googleapis/google-cloud-go/commit/5823db5d633069999b58b9131a7f9cd77e82c899))
367+* **auth/oauth2adapt:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
368+* **auth:** Update golang.org/x/net to v0.17.0 ([174da47](https://github.com/googleapis/google-cloud-go/commit/174da47254fefb12921bbfc65b7829a453af6f5d))
vendor/cloud.google.com/go/auth/LICENSEnew file+202
@@ -0,0 +1,202 @@
3+ Version 2.0, January 2004
4+ http://www.apache.org/licenses/
6+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10+ "License" shall mean the terms and conditions for use, reproduction,
11+ and distribution as defined by Sections 1 through 9 of this document.
13+ "Licensor" shall mean the copyright owner or entity authorized by
14+ the copyright owner that is granting the License.
16+ "Legal Entity" shall mean the union of the acting entity and all
17+ other entities that control, are controlled by, or are under common
18+ control with that entity. For the purposes of this definition,
19+ "control" means (i) the power, direct or indirect, to cause the
20+ direction or management of such entity, whether by contract or
21+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22+ outstanding shares, or (iii) beneficial ownership of such entity.
24+ "You" (or "Your") shall mean an individual or Legal Entity
25+ exercising permissions granted by this License.
27+ "Source" form shall mean the preferred form for making modifications,
28+ including but not limited to software source code, documentation
29+ source, and configuration files.
31+ "Object" form shall mean any form resulting from mechanical
32+ transformation or translation of a Source form, including but
33+ not limited to compiled object code, generated documentation,
34+ and conversions to other media types.
36+ "Work" shall mean the work of authorship, whether in Source or
37+ Object form, made available under the License, as indicated by a
38+ copyright notice that is included in or attached to the work
39+ (an example is provided in the Appendix below).
41+ "Derivative Works" shall mean any work, whether in Source or Object
42+ form, that is based on (or derived from) the Work and for which the
43+ editorial revisions, annotations, elaborations, or other modifications
44+ represent, as a whole, an original work of authorship. For the purposes
45+ of this License, Derivative Works shall not include works that remain
46+ separable from, or merely link (or bind by name) to the interfaces of,
47+ the Work and Derivative Works thereof.
49+ "Contribution" shall mean any work of authorship, including
50+ the original version of the Work and any modifications or additions
51+ to that Work or Derivative Works thereof, that is intentionally
52+ submitted to Licensor for inclusion in the Work by the copyright owner
53+ or by an individual or Legal Entity authorized to submit on behalf of
54+ the copyright owner. For the purposes of this definition, "submitted"
55+ means any form of electronic, verbal, or written communication sent
56+ to the Licensor or its representatives, including but not limited to
57+ communication on electronic mailing lists, source code control systems,
58+ and issue tracking systems that are managed by, or on behalf of, the
59+ Licensor for the purpose of discussing and improving the Work, but
60+ excluding communication that is conspicuously marked or otherwise
61+ designated in writing by the copyright owner as "Not a Contribution."
63+ "Contributor" shall mean Licensor and any individual or Legal Entity
64+ on behalf of whom a Contribution has been received by Licensor and
65+ subsequently incorporated within the Work.
67+ 2. Grant of Copyright License. Subject to the terms and conditions of
68+ this License, each Contributor hereby grants to You a perpetual,
69+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70+ copyright license to reproduce, prepare Derivative Works of,
71+ publicly display, publicly perform, sublicense, and distribute the
72+ Work and such Derivative Works in Source or Object form.
74+ 3. Grant of Patent License. Subject to the terms and conditions of
75+ this License, each Contributor hereby grants to You a perpetual,
76+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77+ (except as stated in this section) patent license to make, have made,
78+ use, offer to sell, sell, import, and otherwise transfer the Work,
79+ where such license applies only to those patent claims licensable
80+ by such Contributor that are necessarily infringed by their
81+ Contribution(s) alone or by combination of their Contribution(s)
82+ with the Work to which such Contribution(s) was submitted. If You
83+ institute patent litigation against any entity (including a
84+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85+ or a Contribution incorporated within the Work constitutes direct
86+ or contributory patent infringement, then any patent licenses
87+ granted to You under this License for that Work shall terminate
88+ as of the date such litigation is filed.
90+ 4. Redistribution. You may reproduce and distribute copies of the
91+ Work or Derivative Works thereof in any medium, with or without
92+ modifications, and in Source or Object form, provided that You
93+ meet the following conditions:
95+ (a) You must give any other recipients of the Work or
96+ Derivative Works a copy of this License; and
98+ (b) You must cause any modified files to carry prominent notices
99+ stating that You changed the files; and
101+ (c) You must retain, in the Source form of any Derivative Works
102+ that You distribute, all copyright, patent, trademark, and
103+ attribution notices from the Source form of the Work,
104+ excluding those notices that do not pertain to any part of
105+ the Derivative Works; and
107+ (d) If the Work includes a "NOTICE" text file as part of its
108+ distribution, then any Derivative Works that You distribute must
109+ include a readable copy of the attribution notices contained
110+ within such NOTICE file, excluding those notices that do not
111+ pertain to any part of the Derivative Works, in at least one
112+ of the following places: within a NOTICE text file distributed
113+ as part of the Derivative Works; within the Source form or
114+ documentation, if provided along with the Derivative Works; or,
115+ within a display generated by the Derivative Works, if and
116+ wherever such third-party notices normally appear. The contents
117+ of the NOTICE file are for informational purposes only and
118+ do not modify the License. You may add Your own attribution
119+ notices within Derivative Works that You distribute, alongside
120+ or as an addendum to the NOTICE text from the Work, provided
121+ that such additional attribution notices cannot be construed
122+ as modifying the License.
124+ You may add Your own copyright statement to Your modifications and
125+ may provide additional or different license terms and conditions
126+ for use, reproduction, or distribution of Your modifications, or
127+ for any such Derivative Works as a whole, provided Your use,
128+ reproduction, and distribution of the Work otherwise complies with
129+ the conditions stated in this License.
131+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132+ any Contribution intentionally submitted for inclusion in the Work
133+ by You to the Licensor shall be under the terms and conditions of
134+ this License, without any additional terms or conditions.
135+ Notwithstanding the above, nothing herein shall supersede or modify
136+ the terms of any separate license agreement you may have executed
137+ with Licensor regarding such Contributions.
139+ 6. Trademarks. This License does not grant permission to use the trade
140+ names, trademarks, service marks, or product names of the Licensor,
141+ except as required for reasonable and customary use in describing the
142+ origin of the Work and reproducing the content of the NOTICE file.
144+ 7. Disclaimer of Warranty. Unless required by applicable law or
145+ agreed to in writing, Licensor provides the Work (and each
146+ Contributor provides its Contributions) on an "AS IS" BASIS,
147+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148+ implied, including, without limitation, any warranties or conditions
149+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150+ PARTICULAR PURPOSE. You are solely responsible for determining the
151+ appropriateness of using or redistributing the Work and assume any
152+ risks associated with Your exercise of permissions under this License.
154+ 8. Limitation of Liability. In no event and under no legal theory,
155+ whether in tort (including negligence), contract, or otherwise,
156+ unless required by applicable law (such as deliberate and grossly
157+ negligent acts) or agreed to in writing, shall any Contributor be
158+ liable to You for damages, including any direct, indirect, special,
159+ incidental, or consequential damages of any character arising as a
160+ result of this License or out of the use or inability to use the
161+ Work (including but not limited to damages for loss of goodwill,
162+ work stoppage, computer failure or malfunction, or any and all
163+ other commercial damages or losses), even if such Contributor
164+ has been advised of the possibility of such damages.
166+ 9. Accepting Warranty or Additional Liability. While redistributing
167+ the Work or Derivative Works thereof, You may choose to offer,
168+ and charge a fee for, acceptance of support, warranty, indemnity,
169+ or other liability obligations and/or rights consistent with this
170+ License. However, in accepting such obligations, You may act only
171+ on Your own behalf and on Your sole responsibility, not on behalf
172+ of any other Contributor, and only if You agree to indemnify,
173+ defend, and hold each Contributor harmless for any liability
174+ incurred by, or claims asserted against, such Contributor by reason
175+ of your accepting any such warranty or additional liability.
177+ END OF TERMS AND CONDITIONS
179+ APPENDIX: How to apply the Apache License to your work.
181+ To apply the Apache License to your work, attach the following
182+ boilerplate notice, with the fields enclosed by brackets "[]"
183+ replaced with your own identifying information. (Don't include
184+ the brackets!) The text should be enclosed in the appropriate
185+ comment syntax for the file format. We also recommend that a
186+ file or class name and description of purpose be included on the
187+ same "printed page" as the copyright notice for easier
188+ identification within third-party archives.
190+ Copyright [yyyy] [name of copyright owner]
192+ Licensed under the Apache License, Version 2.0 (the "License");
193+ you may not use this file except in compliance with the License.
194+ You may obtain a copy of the License at
196+ http://www.apache.org/licenses/LICENSE-2.0
198+ Unless required by applicable law or agreed to in writing, software
199+ distributed under the License is distributed on an "AS IS" BASIS,
200+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201+ See the License for the specific language governing permissions and
202+ limitations under the License.
vendor/cloud.google.com/go/auth/README.mdnew file+40
@@ -0,0 +1,40 @@
1+# Google Auth Library for Go
3+[](https://pkg.go.dev/cloud.google.com/go/auth)
8+go get cloud.google.com/go/auth@latest
13+The most common way this library is used is transitively, by default, from any
14+of our Go client libraries.
18+- To create a credential directly please see examples in the
19+ [credentials](https://pkg.go.dev/cloud.google.com/go/auth/credentials)
21+- To create a authenticated HTTP client please see examples in the
22+ [httptransport](https://pkg.go.dev/cloud.google.com/go/auth/httptransport)
24+- To create a authenticated gRPC connection please see examples in the
25+ [grpctransport](https://pkg.go.dev/cloud.google.com/go/auth/grpctransport)
27+- To create an ID token please see examples in the
28+ [idtoken](https://pkg.go.dev/cloud.google.com/go/auth/credentials/idtoken)
33+Contributions are welcome. Please, see the
34+[CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md)
37+Please note that this project is released with a Contributor Code of Conduct.
38+By participating in this project you agree to abide by its terms.
39+See [Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct)
vendor/cloud.google.com/go/auth/auth.gonew file+618
@@ -0,0 +1,618 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package auth provides utilities for managing Google Cloud credentials,
16+// including functionality for creating, caching, and refreshing OAuth2 tokens.
17+// It offers customizable options for different OAuth2 flows, such as 2-legged
18+// (2LO) and 3-legged (3LO) OAuth, along with support for PKCE and automatic
34+ "cloud.google.com/go/auth/internal"
35+ "cloud.google.com/go/auth/internal/jwt"
36+ "github.com/googleapis/gax-go/v2/internallog"
40+ // Parameter keys for AuthCodeURL method to support PKCE.
41+ codeChallengeKey = "code_challenge"
42+ codeChallengeMethodKey = "code_challenge_method"
44+ // Parameter key for Exchange method to support PKCE.
45+ codeVerifierKey = "code_verifier"
47+ // 3 minutes and 45 seconds before expiration. The shortest MDS cache is 4 minutes,
48+ // so we give it 15 seconds to refresh it's cache before attempting to refresh a token.
49+ defaultExpiryDelta = 225 * time.Second
51+ universeDomainDefault = "googleapis.com"
54+// tokenState represents different states for a [Token].
58+ // fresh indicates that the [Token] is valid. It is not expired or close to
59+ // expired, or the token has no expiry.
60+ fresh tokenState = iota
61+ // stale indicates that the [Token] is close to expired, and should be
62+ // refreshed. The token can be used normally.
64+ // invalid indicates that the [Token] is expired or invalid. The token
65+ // cannot be used for a normal operation.
70+ defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
71+ defaultHeader = &jwt.Header{Algorithm: jwt.HeaderAlgRSA256, Type: jwt.HeaderType}
77+// TokenProvider specifies an interface for anything that can return a token.
78+type TokenProvider interface {
79+ // Token returns a Token or an error.
80+ // The Token returned must be safe to use
82+ // The returned Token must not be modified.
83+ // The context provided must be sent along to any requests that are made in
84+ // the implementing code.
85+ Token(context.Context) (*Token, error)
88+// Token holds the credential token used to authorized requests. All fields are
89+// considered read-only.
91+ // Value is the token used to authorize requests. It is usually an access
92+ // token but may be other types of tokens such as ID tokens in some flows.
94+ // Type is the type of token Value is. If uninitialized, it should be
95+ // assumed to be a "Bearer" token.
97+ // Expiry is the time the token is set to expire.
99+ // Metadata may include, but is not limited to, the body of the token
100+ // response returned by the server.
101+ Metadata map[string]interface{} // TODO(codyoss): maybe make a method to flatten metadata to avoid []string for url.Values
104+// IsValid reports that a [Token] is non-nil, has a [Token.Value], and has not
105+// expired. A token is considered expired if [Token.Expiry] has passed or will
106+// pass in the next 225 seconds.
107+func (t *Token) IsValid() bool {
108+ return t.isValidWithEarlyExpiry(defaultExpiryDelta)
111+// MetadataString is a convenience method for accessing string values in the
112+// token's metadata. Returns an empty string if the metadata is nil or the value
113+// for the given key cannot be cast to a string.
114+func (t *Token) MetadataString(k string) string {
115+ if t.Metadata == nil {
118+ s, ok := t.Metadata[k].(string)
125+func (t *Token) isValidWithEarlyExpiry(earlyExpiry time.Duration) bool {
129+ if t.Expiry.IsZero() {
132+ return !t.Expiry.Round(0).Add(-earlyExpiry).Before(timeNow())
135+func (t *Token) isEmpty() bool {
136+ return t == nil || t.Value == ""
139+// Credentials holds Google credentials, including
140+// [Application Default Credentials].
142+// [Application Default Credentials]: https://developers.google.com/accounts/docs/application-default-credentials
143+type Credentials struct {
145+ projectID CredentialsPropertyProvider
146+ quotaProjectID CredentialsPropertyProvider
147+ // universeDomain is the default service domain for a given Cloud universe.
148+ universeDomain CredentialsPropertyProvider
153+// JSON returns the bytes associated with the the file used to source
154+// credentials if one was used.
155+func (c *Credentials) JSON() []byte {
159+// ProjectID returns the associated project ID from the underlying file or
161+func (c *Credentials) ProjectID(ctx context.Context) (string, error) {
162+ if c.projectID == nil {
163+ return internal.GetProjectID(c.json, ""), nil
165+ v, err := c.projectID.GetProperty(ctx)
169+ return internal.GetProjectID(c.json, v), nil
172+// QuotaProjectID returns the associated quota project ID from the underlying
173+// file or environment.
174+func (c *Credentials) QuotaProjectID(ctx context.Context) (string, error) {
175+ if c.quotaProjectID == nil {
176+ return internal.GetQuotaProject(c.json, ""), nil
178+ v, err := c.quotaProjectID.GetProperty(ctx)
182+ return internal.GetQuotaProject(c.json, v), nil
185+// UniverseDomain returns the default service domain for a given Cloud universe.
186+// The default value is "googleapis.com".
187+func (c *Credentials) UniverseDomain(ctx context.Context) (string, error) {
188+ if c.universeDomain == nil {
189+ return universeDomainDefault, nil
191+ v, err := c.universeDomain.GetProperty(ctx)
196+ return universeDomainDefault, nil
201+// CredentialsPropertyProvider provides an implementation to fetch a property
202+// value for [Credentials].
203+type CredentialsPropertyProvider interface {
204+ GetProperty(context.Context) (string, error)
207+// CredentialsPropertyFunc is a type adapter to allow the use of ordinary
208+// functions as a [CredentialsPropertyProvider].
209+type CredentialsPropertyFunc func(context.Context) (string, error)
211+// GetProperty loads the properly value provided the given context.
212+func (p CredentialsPropertyFunc) GetProperty(ctx context.Context) (string, error) {
216+// CredentialsOptions are used to configure [Credentials].
217+type CredentialsOptions struct {
218+ // TokenProvider is a means of sourcing a token for the credentials. Required.
219+ TokenProvider TokenProvider
220+ // JSON is the raw contents of the credentials file if sourced from a file.
222+ // ProjectIDProvider resolves the project ID associated with the
224+ ProjectIDProvider CredentialsPropertyProvider
225+ // QuotaProjectIDProvider resolves the quota project ID associated with the
227+ QuotaProjectIDProvider CredentialsPropertyProvider
228+ // UniverseDomainProvider resolves the universe domain with the credentials.
229+ UniverseDomainProvider CredentialsPropertyProvider
232+// NewCredentials returns new [Credentials] from the provided options.
233+func NewCredentials(opts *CredentialsOptions) *Credentials {
234+ creds := &Credentials{
235+ TokenProvider: opts.TokenProvider,
237+ projectID: opts.ProjectIDProvider,
238+ quotaProjectID: opts.QuotaProjectIDProvider,
239+ universeDomain: opts.UniverseDomainProvider,
245+// CachedTokenProviderOptions provides options for configuring a cached
247+type CachedTokenProviderOptions struct {
248+ // DisableAutoRefresh makes the TokenProvider always return the same token,
249+ // even if it is expired. The default is false. Optional.
250+ DisableAutoRefresh bool
251+ // ExpireEarly configures the amount of time before a token expires, that it
252+ // should be refreshed. If unset, the default value is 3 minutes and 45
253+ // seconds. Optional.
254+ ExpireEarly time.Duration
255+ // DisableAsyncRefresh configures a synchronous workflow that refreshes
256+ // tokens in a blocking manner. The default is false. Optional.
257+ DisableAsyncRefresh bool
260+func (ctpo *CachedTokenProviderOptions) autoRefresh() bool {
264+ return !ctpo.DisableAutoRefresh
267+func (ctpo *CachedTokenProviderOptions) expireEarly() time.Duration {
268+ if ctpo == nil || ctpo.ExpireEarly == 0 {
269+ return defaultExpiryDelta
271+ return ctpo.ExpireEarly
274+func (ctpo *CachedTokenProviderOptions) blockingRefresh() bool {
278+ return ctpo.DisableAsyncRefresh
281+// NewCachedTokenProvider wraps a [TokenProvider] to cache the tokens returned
282+// by the underlying provider. By default it will refresh tokens asynchronously
283+// a few minutes before they expire.
284+func NewCachedTokenProvider(tp TokenProvider, opts *CachedTokenProviderOptions) TokenProvider {
285+ if ctp, ok := tp.(*cachedTokenProvider); ok {
288+ return &cachedTokenProvider{
290+ autoRefresh: opts.autoRefresh(),
291+ expireEarly: opts.expireEarly(),
292+ blockingRefresh: opts.blockingRefresh(),
296+type cachedTokenProvider struct {
299+ expireEarly time.Duration
300+ blockingRefresh bool
304+ // isRefreshRunning ensures that the non-blocking refresh will only be
305+ // attempted once, even if multiple callers enter the Token method.
306+ isRefreshRunning bool
307+ // isRefreshErr ensures that the non-blocking refresh will only be attempted
308+ // once per refresh window if an error is encountered.
312+func (c *cachedTokenProvider) Token(ctx context.Context) (*Token, error) {
313+ if c.blockingRefresh {
314+ return c.tokenBlocking(ctx)
316+ return c.tokenNonBlocking(ctx)
319+func (c *cachedTokenProvider) tokenNonBlocking(ctx context.Context) (*Token, error) {
320+ switch c.tokenState() {
324+ return c.cachedToken, nil
326+ // Call tokenAsync with a new Context because the user-provided context
327+ // may have a short timeout incompatible with async token refresh.
328+ c.tokenAsync(context.Background())
329+ // Return the stale token immediately to not block customer requests to Cloud services.
332+ return c.cachedToken, nil
334+ return c.tokenBlocking(ctx)
338+// tokenState reports the token's validity.
339+func (c *cachedTokenProvider) tokenState() tokenState {
344+ if t == nil || t.Value == "" {
346+ } else if t.Expiry.IsZero() {
348+ } else if now.After(t.Expiry.Round(0)) {
350+ } else if now.After(t.Expiry.Round(0).Add(-c.expireEarly)) {
356+// tokenAsync uses a bool to ensure that only one non-blocking token refresh
357+// happens at a time, even if multiple callers have entered this function
358+// concurrently. This avoids creating an arbitrary number of concurrent
359+// goroutines. Retries should be attempted and managed within the Token method.
360+// If the refresh attempt fails, no further attempts are made until the refresh
361+// window expires and the token enters the invalid state, at which point the
362+// blocking call to Token should likely return the same error on the main goroutine.
363+func (c *cachedTokenProvider) tokenAsync(ctx context.Context) {
366+ c.isRefreshRunning = true
368+ t, err := c.tp.Token(ctx)
371+ c.isRefreshRunning = false
373+ // Discard errors from the non-blocking refresh, but prevent further
375+ c.isRefreshErr = true
382+ if !c.isRefreshRunning && !c.isRefreshErr {
387+func (c *cachedTokenProvider) tokenBlocking(ctx context.Context) (*Token, error) {
390+ c.isRefreshErr = false
391+ if c.cachedToken.IsValid() || (!c.autoRefresh && !c.cachedToken.isEmpty()) {
392+ return c.cachedToken, nil
394+ t, err := c.tp.Token(ctx)
402+// Error is a error associated with retrieving a [Token]. It can hold useful
403+// additional details for debugging.
405+ // Response is the HTTP response associated with error. The body will always
406+ // be already closed and consumed.
407+ Response *http.Response
408+ // Body is the HTTP response body.
410+ // Err is the underlying wrapped error.
413+ // code returned in the token response
415+ // description returned in the token response
417+ // uri returned in the token response
421+func (e *Error) Error() string {
423+ s := fmt.Sprintf("auth: %q", e.code)
424+ if e.description != "" {
425+ s += fmt.Sprintf(" %q", e.description)
428+ s += fmt.Sprintf(" %q", e.uri)
432+ return fmt.Sprintf("auth: cannot fetch token: %v\nResponse: %s", e.Response.StatusCode, e.Body)
435+// Temporary returns true if the error is considered temporary and may be able
437+func (e *Error) Temporary() bool {
438+ if e.Response == nil {
441+ sc := e.Response.StatusCode
442+ return sc == http.StatusInternalServerError || sc == http.StatusServiceUnavailable || sc == http.StatusRequestTimeout || sc == http.StatusTooManyRequests
445+func (e *Error) Unwrap() error {
449+// Style describes how the token endpoint wants to receive the ClientID and
454+ // StyleUnknown means the value has not been initiated. Sending this in
455+ // a request will cause the token exchange to fail.
456+ StyleUnknown Style = iota
457+ // StyleInParams sends client info in the body of a POST request.
459+ // StyleInHeader sends client info using Basic Authorization header.
463+// Options2LO is the configuration settings for doing a 2-legged JWT OAuth2 flow.
464+type Options2LO struct {
465+ // Email is the OAuth2 client ID. This value is set as the "iss" in the
468+ // PrivateKey contains the contents of an RSA private key or the
469+ // contents of a PEM file that contains a private key. It is used to sign
472+ // TokenURL is th URL the JWT is sent to. Required.
474+ // PrivateKeyID is the ID of the key used to sign the JWT. It is used as the
475+ // "kid" in the JWT header. Optional.
477+ // Subject is the used for to impersonate a user. It is used as the "sub" in
478+ // the JWT.m Optional.
480+ // Scopes specifies requested permissions for the token. Optional.
482+ // Expires specifies the lifetime of the token. Optional.
483+ Expires time.Duration
484+ // Audience specifies the "aud" in the JWT. Optional.
486+ // PrivateClaims allows specifying any custom claims for the JWT. Optional.
487+ PrivateClaims map[string]interface{}
489+ // Client is the client to be used to make the underlying token requests.
492+ // UseIDToken requests that the token returned be an ID token if one is
493+ // returned from the server. Optional.
495+ // Logger is used for debug logging. If provided, logging will be enabled
496+ // at the loggers configured level. By default logging is disabled unless
497+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
498+ // logger will be used. Optional.
502+func (o *Options2LO) client() *http.Client {
503+ if o.Client != nil {
506+ return internal.DefaultClient()
509+func (o *Options2LO) validate() error {
511+ return errors.New("auth: options must be provided")
514+ return errors.New("auth: email must be provided")
516+ if len(o.PrivateKey) == 0 {
517+ return errors.New("auth: private key must be provided")
519+ if o.TokenURL == "" {
520+ return errors.New("auth: token URL must be provided")
525+// New2LOTokenProvider returns a [TokenProvider] from the provided options.
526+func New2LOTokenProvider(opts *Options2LO) (TokenProvider, error) {
527+ if err := opts.validate(); err != nil {
530+ return tokenProvider2LO{opts: opts, Client: opts.client(), logger: internallog.New(opts.Logger)}, nil
533+type tokenProvider2LO struct {
539+func (tp tokenProvider2LO) Token(ctx context.Context) (*Token, error) {
540+ pk, err := internal.ParseKey(tp.opts.PrivateKey)
544+ claimSet := &jwt.Claims{
546+ Scope: strings.Join(tp.opts.Scopes, " "),
547+ Aud: tp.opts.TokenURL,
548+ AdditionalClaims: tp.opts.PrivateClaims,
549+ Sub: tp.opts.Subject,
551+ if t := tp.opts.Expires; t > 0 {
552+ claimSet.Exp = time.Now().Add(t).Unix()
554+ if aud := tp.opts.Audience; aud != "" {
558+ h.KeyID = tp.opts.PrivateKeyID
559+ payload, err := jwt.EncodeJWS(&h, claimSet, pk)
564+ v.Set("grant_type", defaultGrantType)
565+ v.Set("assertion", payload)
566+ req, err := http.NewRequestWithContext(ctx, "POST", tp.opts.TokenURL, strings.NewReader(v.Encode()))
570+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
571+ tp.logger.DebugContext(ctx, "2LO token request", "request", internallog.HTTPRequest(req, []byte(v.Encode())))
572+ resp, body, err := internal.DoRequest(tp.Client, req)
574+ return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
576+ tp.logger.DebugContext(ctx, "2LO token response", "response", internallog.HTTPResponse(resp, body))
577+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
583+ // tokenRes is the JSON response body.
584+ var tokenRes struct {
585+ AccessToken string `json:"access_token"`
586+ TokenType string `json:"token_type"`
587+ IDToken string `json:"id_token"`
588+ ExpiresIn int64 `json:"expires_in"`
590+ if err := json.Unmarshal(body, &tokenRes); err != nil {
591+ return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
594+ Value: tokenRes.AccessToken,
595+ Type: tokenRes.TokenType,
597+ token.Metadata = make(map[string]interface{})
598+ json.Unmarshal(body, &token.Metadata) // no error checks for optional fields
600+ if secs := tokenRes.ExpiresIn; secs > 0 {
601+ token.Expiry = time.Now().Add(time.Duration(secs) * time.Second)
603+ if v := tokenRes.IDToken; v != "" {
604+ // decode returned id token to get expiry
605+ claimSet, err := jwt.DecodeJWS(v)
607+ return nil, fmt.Errorf("auth: error decoding JWT token: %w", err)
609+ token.Expiry = time.Unix(claimSet.Exp, 0)
611+ if tp.opts.UseIDToken {
612+ if tokenRes.IDToken == "" {
613+ return nil, fmt.Errorf("auth: response doesn't have JWT token")
615+ token.Value = tokenRes.IDToken
vendor/cloud.google.com/go/auth/credentials/compute.gonew file+90
@@ -0,0 +1,90 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
26+ "cloud.google.com/go/auth"
27+ "cloud.google.com/go/compute/metadata"
31+ computeTokenMetadata = map[string]interface{}{
32+ "auth.google.tokenSource": "compute-metadata",
33+ "auth.google.serviceAccount": "default",
35+ computeTokenURI = "instance/service-accounts/default/token"
38+// computeTokenProvider creates a [cloud.google.com/go/auth.TokenProvider] that
39+// uses the metadata service to retrieve tokens.
40+func computeTokenProvider(opts *DetectOptions, client *metadata.Client) auth.TokenProvider {
41+ return auth.NewCachedTokenProvider(&computeProvider{
44+ }, &auth.CachedTokenProviderOptions{
45+ ExpireEarly: opts.EarlyTokenRefresh,
46+ DisableAsyncRefresh: opts.DisableAsyncRefresh,
50+// computeProvider fetches tokens from the google cloud metadata service.
51+type computeProvider struct {
53+ client *metadata.Client
56+type metadataTokenResp struct {
57+ AccessToken string `json:"access_token"`
58+ ExpiresInSec int `json:"expires_in"`
59+ TokenType string `json:"token_type"`
62+func (cs *computeProvider) Token(ctx context.Context) (*auth.Token, error) {
63+ tokenURI, err := url.Parse(computeTokenURI)
67+ if len(cs.scopes) > 0 {
69+ v.Set("scopes", strings.Join(cs.scopes, ","))
70+ tokenURI.RawQuery = v.Encode()
72+ tokenJSON, err := cs.client.GetWithContext(ctx, tokenURI.String())
74+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
76+ var res metadataTokenResp
77+ if err := json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res); err != nil {
78+ return nil, fmt.Errorf("credentials: invalid token JSON from metadata: %w", err)
80+ if res.ExpiresInSec == 0 || res.AccessToken == "" {
81+ return nil, errors.New("credentials: incomplete token received from metadata")
84+ Value: res.AccessToken,
86+ Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second),
87+ Metadata: computeTokenMetadata,
vendor/cloud.google.com/go/auth/credentials/detect.gonew file+279
@@ -0,0 +1,279 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
27+ "cloud.google.com/go/auth"
28+ "cloud.google.com/go/auth/internal"
29+ "cloud.google.com/go/auth/internal/credsfile"
30+ "cloud.google.com/go/compute/metadata"
31+ "github.com/googleapis/gax-go/v2/internallog"
35+ // jwtTokenURL is Google's OAuth 2.0 token URL to use with the JWT(2LO) flow.
36+ jwtTokenURL = "https://oauth2.googleapis.com/token"
38+ // Google's OAuth 2.0 default endpoints.
39+ googleAuthURL = "https://accounts.google.com/o/oauth2/auth"
40+ googleTokenURL = "https://oauth2.googleapis.com/token"
42+ // GoogleMTLSTokenURL is Google's default OAuth2.0 mTLS endpoint.
43+ GoogleMTLSTokenURL = "https://oauth2.mtls.googleapis.com/token"
45+ // Help on default credentials
46+ adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc"
51+ allowOnGCECheck = true
54+// OnGCE reports whether this process is running in Google Cloud.
56+ // TODO(codyoss): once all libs use this auth lib move metadata check here
57+ return allowOnGCECheck && metadata.OnGCE()
60+// DetectDefault searches for "Application Default Credentials" and returns
61+// a credential based on the [DetectOptions] provided.
63+// It looks for credentials in the following places, preferring the first
66+// - A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS
67+// environment variable. For workload identity federation, refer to
68+// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation
69+// on how to generate the JSON configuration file for on-prem/non-Google
71+// - A JSON file in a location known to the gcloud command-line tool. On
72+// Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On
73+// other systems, $HOME/.config/gcloud/application_default_credentials.json.
74+// - On Google Compute Engine, Google App Engine standard second generation
75+// runtimes, and Google App Engine flexible environment, it fetches
76+// credentials from the metadata server.
77+func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) {
78+ if err := opts.validate(); err != nil {
81+ if len(opts.CredentialsJSON) > 0 {
82+ return readCredentialsFileJSON(opts.CredentialsJSON, opts)
84+ if opts.CredentialsFile != "" {
85+ return readCredentialsFile(opts.CredentialsFile, opts)
87+ if filename := os.Getenv(credsfile.GoogleAppCredsEnvVar); filename != "" {
88+ creds, err := readCredentialsFile(filename, opts)
95+ fileName := credsfile.GetWellKnownFileName()
96+ if b, err := os.ReadFile(fileName); err == nil {
97+ return readCredentialsFileJSON(b, opts)
101+ metadataClient := metadata.NewWithOptions(&metadata.Options{
102+ Logger: opts.logger(),
104+ return auth.NewCredentials(&auth.CredentialsOptions{
105+ TokenProvider: computeTokenProvider(opts, metadataClient),
106+ ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) {
107+ return metadataClient.ProjectIDWithContext(ctx)
109+ UniverseDomainProvider: &internal.ComputeUniverseDomainProvider{
110+ MetadataClient: metadataClient,
115+ return nil, fmt.Errorf("credentials: could not find default credentials. See %v for more information", adcSetupURL)
118+// DetectOptions provides configuration for [DetectDefault].
119+type DetectOptions struct {
120+ // Scopes that credentials tokens should have. Example:
121+ // https://www.googleapis.com/auth/cloud-platform. Required if Audience is
124+ // Audience that credentials tokens should have. Only applicable for 2LO
125+ // flows with service accounts. If specified, scopes should not be provided.
127+ // Subject is the user email used for [domain wide delegation](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority).
130+ // EarlyTokenRefresh configures how early before a token expires that it
131+ // should be refreshed. Once the token’s time until expiration has entered
132+ // this refresh window the token is considered valid but stale. If unset,
133+ // the default value is 3 minutes and 45 seconds. Optional.
134+ EarlyTokenRefresh time.Duration
135+ // DisableAsyncRefresh configures a synchronous workflow that refreshes
136+ // stale tokens while blocking. The default is false. Optional.
137+ DisableAsyncRefresh bool
138+ // AuthHandlerOptions configures an authorization handler and other options
139+ // for 3LO flows. It is required, and only used, for client credential
141+ AuthHandlerOptions *auth.AuthorizationHandlerOptions
142+ // TokenURL allows to set the token endpoint for user credential flows. If
143+ // unset the default value is: https://oauth2.googleapis.com/token.
146+ // STSAudience is the audience sent to when retrieving an STS token.
147+ // Currently this only used for GDCH auth flow, for which it is required.
149+ // CredentialsFile overrides detection logic and sources a credential file
150+ // from the provided filepath. If provided, CredentialsJSON must not be.
152+ CredentialsFile string
153+ // CredentialsJSON overrides detection logic and uses the JSON bytes as the
154+ // source for the credential. If provided, CredentialsFile must not be.
156+ CredentialsJSON []byte
157+ // UseSelfSignedJWT directs service account based credentials to create a
158+ // self-signed JWT with the private key found in the file, skipping any
159+ // network requests that would normally be made. Optional.
160+ UseSelfSignedJWT bool
161+ // Client configures the underlying client used to make network requests
162+ // when fetching tokens. Optional.
164+ // UniverseDomain is the default service domain for a given Cloud universe.
165+ // The default value is "googleapis.com". This option is ignored for
166+ // authentication flows that do not support universe domain. Optional.
167+ UniverseDomain string
168+ // Logger is used for debug logging. If provided, logging will be enabled
169+ // at the loggers configured level. By default logging is disabled unless
170+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
171+ // logger will be used. Optional.
175+func (o *DetectOptions) validate() error {
177+ return errors.New("credentials: options must be provided")
179+ if len(o.Scopes) > 0 && o.Audience != "" {
180+ return errors.New("credentials: both scopes and audience were provided")
182+ if len(o.CredentialsJSON) > 0 && o.CredentialsFile != "" {
183+ return errors.New("credentials: both credentials file and JSON were provided")
188+func (o *DetectOptions) tokenURL() string {
189+ if o.TokenURL != "" {
192+ return googleTokenURL
195+func (o *DetectOptions) scopes() []string {
196+ scopes := make([]string, len(o.Scopes))
197+ copy(scopes, o.Scopes)
201+func (o *DetectOptions) client() *http.Client {
202+ if o.Client != nil {
205+ return internal.DefaultClient()
208+func (o *DetectOptions) logger() *slog.Logger {
209+ return internallog.New(o.Logger)
212+func readCredentialsFile(filename string, opts *DetectOptions) (*auth.Credentials, error) {
213+ b, err := os.ReadFile(filename)
217+ return readCredentialsFileJSON(b, opts)
220+func readCredentialsFileJSON(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
221+ // attempt to parse jsonData as a Google Developers Console client_credentials.json.
222+ config := clientCredConfigFromJSON(b, opts)
224+ if config.AuthHandlerOpts == nil {
225+ return nil, errors.New("credentials: auth handler must be specified for this credential filetype")
227+ tp, err := auth.New3LOTokenProvider(config)
231+ return auth.NewCredentials(&auth.CredentialsOptions{
236+ return fileCredentials(b, opts)
239+func clientCredConfigFromJSON(b []byte, opts *DetectOptions) *auth.Options3LO {
240+ var creds credsfile.ClientCredentialsFile
241+ var c *credsfile.Config3LO
242+ if err := json.Unmarshal(b, &creds); err != nil {
246+ case creds.Web != nil:
248+ case creds.Installed != nil:
253+ if len(c.RedirectURIs) < 1 {
256+ var handleOpts *auth.AuthorizationHandlerOptions
257+ if opts.AuthHandlerOptions != nil {
258+ handleOpts = &auth.AuthorizationHandlerOptions{
259+ Handler: opts.AuthHandlerOptions.Handler,
260+ State: opts.AuthHandlerOptions.State,
261+ PKCEOpts: opts.AuthHandlerOptions.PKCEOpts,
264+ return &auth.Options3LO{
265+ ClientID: c.ClientID,
266+ ClientSecret: c.ClientSecret,
267+ RedirectURL: c.RedirectURIs[0],
268+ Scopes: opts.scopes(),
270+ TokenURL: c.TokenURI,
271+ Client: opts.client(),
272+ Logger: opts.logger(),
273+ EarlyTokenExpiry: opts.EarlyTokenRefresh,
274+ AuthHandlerOpts: handleOpts,
275+ // TODO(codyoss): refactor this out. We need to add in auto-detection
276+ // for this use case.
277+ AuthStyle: auth.StyleInParams,
vendor/cloud.google.com/go/auth/credentials/doc.gonew file+45
@@ -0,0 +1,45 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package credentials provides support for making OAuth2 authorized and
16+// authenticated HTTP requests to Google APIs. It supports the Web server flow,
17+// client-side credentials, service accounts, Google Compute Engine service
18+// accounts, Google App Engine service accounts and workload identity federation
19+// from non-Google cloud platforms.
21+// A brief overview of the package follows. For more information, please read
22+// https://developers.google.com/accounts/docs/OAuth2
24+// https://developers.google.com/accounts/docs/application-default-credentials.
25+// For more information on using workload identity federation, refer to
26+// https://cloud.google.com/iam/docs/how-to#using-workload-identity-federation.
30+// The [cloud.google.com/go/auth.Credentials] type represents Google
31+// credentials, including Application Default Credentials.
33+// Use [DetectDefault] to obtain Application Default Credentials.
35+// Application Default Credentials support workload identity federation to
36+// access Google Cloud resources from non-Google Cloud platforms including Amazon
37+// Web Services (AWS), Microsoft Azure or any identity provider that supports
38+// OpenID Connect (OIDC). Workload identity federation is recommended for
39+// non-Google Cloud environments as it avoids the need to download, manage, and
40+// store service account private keys locally.
42+// # Workforce Identity Federation
44+// For more information on this feature see [cloud.google.com/go/auth/credentials/externalaccount].
vendor/cloud.google.com/go/auth/credentials/filetypes.gonew file+231
@@ -0,0 +1,231 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
21+ "cloud.google.com/go/auth"
22+ "cloud.google.com/go/auth/credentials/internal/externalaccount"
23+ "cloud.google.com/go/auth/credentials/internal/externalaccountuser"
24+ "cloud.google.com/go/auth/credentials/internal/gdch"
25+ "cloud.google.com/go/auth/credentials/internal/impersonate"
26+ internalauth "cloud.google.com/go/auth/internal"
27+ "cloud.google.com/go/auth/internal/credsfile"
30+func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
31+ fileType, err := credsfile.ParseFileType(b)
36+ var projectID, universeDomain string
37+ var tp auth.TokenProvider
39+ case credsfile.ServiceAccountKey:
40+ f, err := credsfile.ParseServiceAccount(b)
44+ tp, err = handleServiceAccount(f, opts)
48+ projectID = f.ProjectID
49+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
50+ case credsfile.UserCredentialsKey:
51+ f, err := credsfile.ParseUserCredentials(b)
55+ tp, err = handleUserCredential(f, opts)
59+ universeDomain = f.UniverseDomain
60+ case credsfile.ExternalAccountKey:
61+ f, err := credsfile.ParseExternalAccount(b)
65+ tp, err = handleExternalAccount(f, opts)
69+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
70+ case credsfile.ExternalAccountAuthorizedUserKey:
71+ f, err := credsfile.ParseExternalAccountAuthorizedUser(b)
75+ tp, err = handleExternalAccountAuthorizedUser(f, opts)
79+ universeDomain = f.UniverseDomain
80+ case credsfile.ImpersonatedServiceAccountKey:
81+ f, err := credsfile.ParseImpersonatedServiceAccount(b)
85+ tp, err = handleImpersonatedServiceAccount(f, opts)
89+ universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
90+ case credsfile.GDCHServiceAccountKey:
91+ f, err := credsfile.ParseGDCHServiceAccount(b)
95+ tp, err = handleGDCHServiceAccount(f, opts)
99+ projectID = f.Project
100+ universeDomain = f.UniverseDomain
102+ return nil, fmt.Errorf("credentials: unsupported filetype %q", fileType)
104+ return auth.NewCredentials(&auth.CredentialsOptions{
105+ TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{
106+ ExpireEarly: opts.EarlyTokenRefresh,
109+ ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID),
110+ // TODO(codyoss): only set quota project here if there was a user override
111+ UniverseDomainProvider: internalauth.StaticCredentialsProperty(universeDomain),
115+// resolveUniverseDomain returns optsUniverseDomain if non-empty, in order to
116+// support configuring universe-specific credentials in code. Auth flows
117+// unsupported for universe domain should not use this func, but should instead
118+// simply set the file universe domain on the credentials.
119+func resolveUniverseDomain(optsUniverseDomain, fileUniverseDomain string) string {
120+ if optsUniverseDomain != "" {
121+ return optsUniverseDomain
123+ return fileUniverseDomain
126+func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
127+ ud := resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
128+ if opts.UseSelfSignedJWT {
129+ return configureSelfSignedJWT(f, opts)
130+ } else if ud != "" && ud != internalauth.DefaultUniverseDomain {
131+ // For non-GDU universe domains, token exchange is impossible and services
132+ // must support self-signed JWTs.
133+ opts.UseSelfSignedJWT = true
134+ return configureSelfSignedJWT(f, opts)
136+ opts2LO := &auth.Options2LO{
137+ Email: f.ClientEmail,
138+ PrivateKey: []byte(f.PrivateKey),
139+ PrivateKeyID: f.PrivateKeyID,
140+ Scopes: opts.scopes(),
141+ TokenURL: f.TokenURL,
142+ Subject: opts.Subject,
143+ Client: opts.client(),
144+ Logger: opts.logger(),
146+ if opts2LO.TokenURL == "" {
147+ opts2LO.TokenURL = jwtTokenURL
149+ return auth.New2LOTokenProvider(opts2LO)
152+func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions) (auth.TokenProvider, error) {
153+ opts3LO := &auth.Options3LO{
154+ ClientID: f.ClientID,
155+ ClientSecret: f.ClientSecret,
156+ Scopes: opts.scopes(),
157+ AuthURL: googleAuthURL,
158+ TokenURL: opts.tokenURL(),
159+ AuthStyle: auth.StyleInParams,
160+ EarlyTokenExpiry: opts.EarlyTokenRefresh,
161+ RefreshToken: f.RefreshToken,
162+ Client: opts.client(),
163+ Logger: opts.logger(),
165+ return auth.New3LOTokenProvider(opts3LO)
168+func handleExternalAccount(f *credsfile.ExternalAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
169+ externalOpts := &externalaccount.Options{
170+ Audience: f.Audience,
171+ SubjectTokenType: f.SubjectTokenType,
172+ TokenURL: f.TokenURL,
173+ TokenInfoURL: f.TokenInfoURL,
174+ ServiceAccountImpersonationURL: f.ServiceAccountImpersonationURL,
175+ ClientSecret: f.ClientSecret,
176+ ClientID: f.ClientID,
177+ CredentialSource: f.CredentialSource,
178+ QuotaProjectID: f.QuotaProjectID,
179+ Scopes: opts.scopes(),
180+ WorkforcePoolUserProject: f.WorkforcePoolUserProject,
181+ Client: opts.client(),
182+ Logger: opts.logger(),
183+ IsDefaultClient: opts.Client == nil,
185+ if f.ServiceAccountImpersonation != nil {
186+ externalOpts.ServiceAccountImpersonationLifetimeSeconds = f.ServiceAccountImpersonation.TokenLifetimeSeconds
188+ return externalaccount.NewTokenProvider(externalOpts)
191+func handleExternalAccountAuthorizedUser(f *credsfile.ExternalAccountAuthorizedUserFile, opts *DetectOptions) (auth.TokenProvider, error) {
192+ externalOpts := &externalaccountuser.Options{
193+ Audience: f.Audience,
194+ RefreshToken: f.RefreshToken,
195+ TokenURL: f.TokenURL,
196+ TokenInfoURL: f.TokenInfoURL,
197+ ClientID: f.ClientID,
198+ ClientSecret: f.ClientSecret,
199+ Scopes: opts.scopes(),
200+ Client: opts.client(),
201+ Logger: opts.logger(),
203+ return externalaccountuser.NewTokenProvider(externalOpts)
206+func handleImpersonatedServiceAccount(f *credsfile.ImpersonatedServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
207+ if f.ServiceAccountImpersonationURL == "" || f.CredSource == nil {
208+ return nil, errors.New("missing 'source_credentials' field or 'service_account_impersonation_url' in credentials")
211+ tp, err := fileCredentials(f.CredSource, opts)
215+ return impersonate.NewTokenProvider(&impersonate.Options{
216+ URL: f.ServiceAccountImpersonationURL,
217+ Scopes: opts.scopes(),
219+ Delegates: f.Delegates,
220+ Client: opts.client(),
221+ Logger: opts.logger(),
225+func handleGDCHServiceAccount(f *credsfile.GDCHServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
226+ return gdch.NewTokenProvider(f, &gdch.Options{
227+ STSAudience: opts.STSAudience,
228+ Client: opts.client(),
229+ Logger: opts.logger(),
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/aws_provider.gonew file+531
@@ -0,0 +1,531 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
35+ "cloud.google.com/go/auth/internal"
36+ "github.com/googleapis/gax-go/v2/internallog"
40+ // getenv aliases os.Getenv for testing
45+ // AWS Signature Version 4 signing algorithm identifier.
46+ awsAlgorithm = "AWS4-HMAC-SHA256"
48+ // The termination string for the AWS credential scope value as defined in
49+ // https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
50+ awsRequestType = "aws4_request"
52+ // The AWS authorization header name for the security session token if available.
53+ awsSecurityTokenHeader = "x-amz-security-token"
55+ // The name of the header containing the session token for metadata endpoint calls
56+ awsIMDSv2SessionTokenHeader = "X-aws-ec2-metadata-token"
58+ awsIMDSv2SessionTTLHeader = "X-aws-ec2-metadata-token-ttl-seconds"
60+ awsIMDSv2SessionTTL = "300"
62+ // The AWS authorization header name for the auto-generated date.
63+ awsDateHeader = "x-amz-date"
65+ defaultRegionalCredentialVerificationURL = "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15"
67+ // Supported AWS configuration environment variables.
68+ awsAccessKeyIDEnvVar = "AWS_ACCESS_KEY_ID"
69+ awsDefaultRegionEnvVar = "AWS_DEFAULT_REGION"
70+ awsRegionEnvVar = "AWS_REGION"
71+ awsSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY"
72+ awsSessionTokenEnvVar = "AWS_SESSION_TOKEN"
74+ awsTimeFormatLong = "20060102T150405Z"
75+ awsTimeFormatShort = "20060102"
76+ awsProviderType = "aws"
79+type awsSubjectProvider struct {
82+ RegionalCredVerificationURL string
83+ CredVerificationURL string
84+ IMDSv2SessionTokenURL string
85+ TargetResource string
86+ requestSigner *awsRequestSigner
88+ securityCredentialsProvider AwsSecurityCredentialsProvider
89+ reqOpts *RequestOptions
95+func (sp *awsSubjectProvider) subjectToken(ctx context.Context) (string, error) {
97+ if sp.RegionalCredVerificationURL == "" {
98+ sp.RegionalCredVerificationURL = defaultRegionalCredentialVerificationURL
100+ headers := make(map[string]string)
101+ if sp.shouldUseMetadataServer() {
102+ awsSessionToken, err := sp.getAWSSessionToken(ctx)
107+ if awsSessionToken != "" {
108+ headers[awsIMDSv2SessionTokenHeader] = awsSessionToken
112+ awsSecurityCredentials, err := sp.getSecurityCredentials(ctx, headers)
116+ if sp.region, err = sp.getRegion(ctx, headers); err != nil {
119+ sp.requestSigner = &awsRequestSigner{
120+ RegionName: sp.region,
121+ AwsSecurityCredentials: awsSecurityCredentials,
124+ // Generate the signed request to AWS STS GetCallerIdentity API.
125+ // Use the required regional endpoint. Otherwise, the request will fail.
126+ req, err := http.NewRequestWithContext(ctx, "POST", strings.Replace(sp.RegionalCredVerificationURL, "{region}", sp.region, 1), nil)
130+ // The full, canonical resource name of the workload identity pool
131+ // provider, with or without the HTTPS prefix.
132+ // Including this header as part of the signature is recommended to
133+ // ensure data integrity.
134+ if sp.TargetResource != "" {
135+ req.Header.Set("x-goog-cloud-target-resource", sp.TargetResource)
137+ sp.requestSigner.signRequest(req)
140+ The GCP STS endpoint expects the headers to be formatted as:
142+ # {key: 'x-amz-date', value: '...'},
143+ # {key: 'Authorization', value: '...'},
146+ # And then serialized as:
147+ # quote(json.dumps({
150+ # headers: [{key: 'x-amz-date', value: '...'}, ...]
154+ awsSignedReq := awsRequest{
155+ URL: req.URL.String(),
158+ for headerKey, headerList := range req.Header {
159+ for _, headerValue := range headerList {
160+ awsSignedReq.Headers = append(awsSignedReq.Headers, awsRequestHeader{
166+ sort.Slice(awsSignedReq.Headers, func(i, j int) bool {
167+ headerCompare := strings.Compare(awsSignedReq.Headers[i].Key, awsSignedReq.Headers[j].Key)
168+ if headerCompare == 0 {
169+ return strings.Compare(awsSignedReq.Headers[i].Value, awsSignedReq.Headers[j].Value) < 0
171+ return headerCompare < 0
174+ result, err := json.Marshal(awsSignedReq)
178+ return url.QueryEscape(string(result)), nil
181+func (sp *awsSubjectProvider) providerType() string {
182+ if sp.securityCredentialsProvider != nil {
183+ return programmaticProviderType
185+ return awsProviderType
188+func (sp *awsSubjectProvider) getAWSSessionToken(ctx context.Context) (string, error) {
189+ if sp.IMDSv2SessionTokenURL == "" {
192+ req, err := http.NewRequestWithContext(ctx, "PUT", sp.IMDSv2SessionTokenURL, nil)
196+ req.Header.Set(awsIMDSv2SessionTTLHeader, awsIMDSv2SessionTTL)
198+ sp.logger.DebugContext(ctx, "aws session token request", "request", internallog.HTTPRequest(req, nil))
199+ resp, body, err := internal.DoRequest(sp.Client, req)
203+ sp.logger.DebugContext(ctx, "aws session token response", "response", internallog.HTTPResponse(resp, body))
204+ if resp.StatusCode != http.StatusOK {
205+ return "", fmt.Errorf("credentials: unable to retrieve AWS session token: %s", body)
207+ return string(body), nil
210+func (sp *awsSubjectProvider) getRegion(ctx context.Context, headers map[string]string) (string, error) {
211+ if sp.securityCredentialsProvider != nil {
212+ return sp.securityCredentialsProvider.AwsRegion(ctx, sp.reqOpts)
214+ if canRetrieveRegionFromEnvironment() {
215+ if envAwsRegion := getenv(awsRegionEnvVar); envAwsRegion != "" {
216+ return envAwsRegion, nil
218+ return getenv(awsDefaultRegionEnvVar), nil
221+ if sp.RegionURL == "" {
222+ return "", errors.New("credentials: unable to determine AWS region")
225+ req, err := http.NewRequestWithContext(ctx, "GET", sp.RegionURL, nil)
230+ for name, value := range headers {
231+ req.Header.Add(name, value)
233+ sp.logger.DebugContext(ctx, "aws region request", "request", internallog.HTTPRequest(req, nil))
234+ resp, body, err := internal.DoRequest(sp.Client, req)
238+ sp.logger.DebugContext(ctx, "aws region response", "response", internallog.HTTPResponse(resp, body))
239+ if resp.StatusCode != http.StatusOK {
240+ return "", fmt.Errorf("credentials: unable to retrieve AWS region - %s", body)
243+ // This endpoint will return the region in format: us-east-2b.
244+ // Only the us-east-2 part should be used.
245+ bodyLen := len(body)
249+ return string(body[:bodyLen-1]), nil
252+func (sp *awsSubjectProvider) getSecurityCredentials(ctx context.Context, headers map[string]string) (result *AwsSecurityCredentials, err error) {
253+ if sp.securityCredentialsProvider != nil {
254+ return sp.securityCredentialsProvider.AwsSecurityCredentials(ctx, sp.reqOpts)
256+ if canRetrieveSecurityCredentialFromEnvironment() {
257+ return &AwsSecurityCredentials{
258+ AccessKeyID: getenv(awsAccessKeyIDEnvVar),
259+ SecretAccessKey: getenv(awsSecretAccessKeyEnvVar),
260+ SessionToken: getenv(awsSessionTokenEnvVar),
264+ roleName, err := sp.getMetadataRoleName(ctx, headers)
268+ credentials, err := sp.getMetadataSecurityCredentials(ctx, roleName, headers)
273+ if credentials.AccessKeyID == "" {
274+ return result, errors.New("credentials: missing AccessKeyId credential")
276+ if credentials.SecretAccessKey == "" {
277+ return result, errors.New("credentials: missing SecretAccessKey credential")
280+ return credentials, nil
283+func (sp *awsSubjectProvider) getMetadataSecurityCredentials(ctx context.Context, roleName string, headers map[string]string) (*AwsSecurityCredentials, error) {
284+ var result *AwsSecurityCredentials
286+ req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("%s/%s", sp.CredVerificationURL, roleName), nil)
290+ for name, value := range headers {
291+ req.Header.Add(name, value)
293+ sp.logger.DebugContext(ctx, "aws security credential request", "request", internallog.HTTPRequest(req, nil))
294+ resp, body, err := internal.DoRequest(sp.Client, req)
298+ sp.logger.DebugContext(ctx, "aws security credential response", "response", internallog.HTTPResponse(resp, body))
299+ if resp.StatusCode != http.StatusOK {
300+ return result, fmt.Errorf("credentials: unable to retrieve AWS security credentials - %s", body)
302+ if err := json.Unmarshal(body, &result); err != nil {
308+func (sp *awsSubjectProvider) getMetadataRoleName(ctx context.Context, headers map[string]string) (string, error) {
309+ if sp.CredVerificationURL == "" {
310+ return "", errors.New("credentials: unable to determine the AWS metadata server security credentials endpoint")
312+ req, err := http.NewRequestWithContext(ctx, "GET", sp.CredVerificationURL, nil)
316+ for name, value := range headers {
317+ req.Header.Add(name, value)
320+ sp.logger.DebugContext(ctx, "aws metadata role request", "request", internallog.HTTPRequest(req, nil))
321+ resp, body, err := internal.DoRequest(sp.Client, req)
325+ sp.logger.DebugContext(ctx, "aws metadata role response", "response", internallog.HTTPResponse(resp, body))
326+ if resp.StatusCode != http.StatusOK {
327+ return "", fmt.Errorf("credentials: unable to retrieve AWS role name - %s", body)
329+ return string(body), nil
332+// awsRequestSigner is a utility class to sign http requests using a AWS V4 signature.
333+type awsRequestSigner struct {
335+ AwsSecurityCredentials *AwsSecurityCredentials
338+// signRequest adds the appropriate headers to an http.Request
339+// or returns an error if something prevented this.
340+func (rs *awsRequestSigner) signRequest(req *http.Request) error {
341+ // req is assumed non-nil
342+ signedRequest := cloneRequest(req)
344+ signedRequest.Header.Set("host", requestHost(req))
345+ if rs.AwsSecurityCredentials.SessionToken != "" {
346+ signedRequest.Header.Set(awsSecurityTokenHeader, rs.AwsSecurityCredentials.SessionToken)
348+ if signedRequest.Header.Get("date") == "" {
349+ signedRequest.Header.Set(awsDateHeader, timestamp.Format(awsTimeFormatLong))
351+ authorizationCode, err := rs.generateAuthentication(signedRequest, timestamp)
355+ signedRequest.Header.Set("Authorization", authorizationCode)
356+ req.Header = signedRequest.Header
360+func (rs *awsRequestSigner) generateAuthentication(req *http.Request, timestamp time.Time) (string, error) {
361+ canonicalHeaderColumns, canonicalHeaderData := canonicalHeaders(req)
362+ dateStamp := timestamp.Format(awsTimeFormatShort)
365+ if splitHost := strings.Split(requestHost(req), "."); len(splitHost) > 0 {
366+ serviceName = splitHost[0]
368+ credentialScope := strings.Join([]string{dateStamp, rs.RegionName, serviceName, awsRequestType}, "/")
369+ requestString, err := canonicalRequest(req, canonicalHeaderColumns, canonicalHeaderData)
373+ requestHash, err := getSha256([]byte(requestString))
378+ stringToSign := strings.Join([]string{awsAlgorithm, timestamp.Format(awsTimeFormatLong), credentialScope, requestHash}, "\n")
379+ signingKey := []byte("AWS4" + rs.AwsSecurityCredentials.SecretAccessKey)
380+ for _, signingInput := range []string{
381+ dateStamp, rs.RegionName, serviceName, awsRequestType, stringToSign,
383+ signingKey, err = getHmacSha256(signingKey, []byte(signingInput))
389+ return fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", awsAlgorithm, rs.AwsSecurityCredentials.AccessKeyID, credentialScope, canonicalHeaderColumns, hex.EncodeToString(signingKey)), nil
392+func getSha256(input []byte) (string, error) {
393+ hash := sha256.New()
394+ if _, err := hash.Write(input); err != nil {
397+ return hex.EncodeToString(hash.Sum(nil)), nil
400+func getHmacSha256(key, input []byte) ([]byte, error) {
401+ hash := hmac.New(sha256.New, key)
402+ if _, err := hash.Write(input); err != nil {
405+ return hash.Sum(nil), nil
408+func cloneRequest(r *http.Request) *http.Request {
409+ r2 := new(http.Request)
411+ if r.Header != nil {
412+ r2.Header = make(http.Header, len(r.Header))
414+ // Find total number of values.
416+ for _, headerValues := range r.Header {
417+ headerCount += len(headerValues)
419+ copiedHeaders := make([]string, headerCount) // shared backing array for headers' values
421+ for headerKey, headerValues := range r.Header {
422+ headerCount = copy(copiedHeaders, headerValues)
423+ r2.Header[headerKey] = copiedHeaders[:headerCount:headerCount]
424+ copiedHeaders = copiedHeaders[headerCount:]
430+func canonicalPath(req *http.Request) string {
431+ result := req.URL.EscapedPath()
435+ return path.Clean(result)
438+func canonicalQuery(req *http.Request) string {
439+ queryValues := req.URL.Query()
440+ for queryKey := range queryValues {
441+ sort.Strings(queryValues[queryKey])
443+ return queryValues.Encode()
446+func canonicalHeaders(req *http.Request) (string, string) {
447+ // Header keys need to be sorted alphabetically.
448+ var headers []string
449+ lowerCaseHeaders := make(http.Header)
450+ for k, v := range req.Header {
451+ k := strings.ToLower(k)
452+ if _, ok := lowerCaseHeaders[k]; ok {
453+ // include additional values
454+ lowerCaseHeaders[k] = append(lowerCaseHeaders[k], v...)
456+ headers = append(headers, k)
457+ lowerCaseHeaders[k] = v
460+ sort.Strings(headers)
462+ var fullHeaders bytes.Buffer
463+ for _, header := range headers {
464+ headerValue := strings.Join(lowerCaseHeaders[header], ",")
465+ fullHeaders.WriteString(header)
466+ fullHeaders.WriteRune(':')
467+ fullHeaders.WriteString(headerValue)
468+ fullHeaders.WriteRune('\n')
471+ return strings.Join(headers, ";"), fullHeaders.String()
474+func requestDataHash(req *http.Request) (string, error) {
475+ var requestData []byte
476+ if req.Body != nil {
477+ requestBody, err := req.GetBody()
481+ defer requestBody.Close()
483+ requestData, err = internal.ReadAll(requestBody)
489+ return getSha256(requestData)
492+func requestHost(req *http.Request) string {
499+func canonicalRequest(req *http.Request, canonicalHeaderColumns, canonicalHeaderData string) (string, error) {
500+ dataHash, err := requestDataHash(req)
504+ return fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", req.Method, canonicalPath(req), canonicalQuery(req), canonicalHeaderData, canonicalHeaderColumns, dataHash), nil
507+type awsRequestHeader struct {
508+ Key string `json:"key"`
509+ Value string `json:"value"`
512+type awsRequest struct {
513+ URL string `json:"url"`
514+ Method string `json:"method"`
515+ Headers []awsRequestHeader `json:"headers"`
518+// The AWS region can be provided through AWS_REGION or AWS_DEFAULT_REGION. Only one is
520+func canRetrieveRegionFromEnvironment() bool {
521+ return getenv(awsRegionEnvVar) != "" || getenv(awsDefaultRegionEnvVar) != ""
524+// Check if both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are available.
525+func canRetrieveSecurityCredentialFromEnvironment() bool {
526+ return getenv(awsAccessKeyIDEnvVar) != "" && getenv(awsSecretAccessKeyEnvVar) != ""
529+func (sp *awsSubjectProvider) shouldUseMetadataServer() bool {
530+ return sp.securityCredentialsProvider == nil && (!canRetrieveRegionFromEnvironment() || !canRetrieveSecurityCredentialFromEnvironment())
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/executable_provider.gonew file+284
@@ -0,0 +1,284 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
30+ "cloud.google.com/go/auth/internal"
34+ executableSupportedMaxVersion = 1
35+ executableDefaultTimeout = 30 * time.Second
36+ executableSource = "response"
37+ executableProviderType = "executable"
38+ outputFileSource = "output file"
40+ allowExecutablesEnvVar = "GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES"
42+ jwtTokenType = "urn:ietf:params:oauth:token-type:jwt"
43+ idTokenType = "urn:ietf:params:oauth:token-type:id_token"
44+ saml2TokenType = "urn:ietf:params:oauth:token-type:saml2"
48+ serviceAccountImpersonationRE = regexp.MustCompile(`https://iamcredentials..+/v1/projects/-/serviceAccounts/(.*@.*):generateAccessToken`)
51+type nonCacheableError struct {
55+func (nce nonCacheableError) Error() string {
59+// environment is a contract for testing
60+type environment interface {
61+ existingEnv() []string
62+ getenv(string) string
63+ run(ctx context.Context, command string, env []string) ([]byte, error)
67+type runtimeEnvironment struct{}
69+func (r runtimeEnvironment) existingEnv() []string {
72+func (r runtimeEnvironment) getenv(key string) string {
73+ return os.Getenv(key)
75+func (r runtimeEnvironment) now() time.Time {
76+ return time.Now().UTC()
79+func (r runtimeEnvironment) run(ctx context.Context, command string, env []string) ([]byte, error) {
80+ splitCommand := strings.Fields(command)
81+ cmd := exec.CommandContext(ctx, splitCommand[0], splitCommand[1:]...)
84+ var stdout, stderr bytes.Buffer
88+ if err := cmd.Run(); err != nil {
89+ if ctx.Err() == context.DeadlineExceeded {
90+ return nil, context.DeadlineExceeded
92+ if exitError, ok := err.(*exec.ExitError); ok {
93+ return nil, exitCodeError(exitError)
95+ return nil, executableError(err)
98+ bytesStdout := bytes.TrimSpace(stdout.Bytes())
99+ if len(bytesStdout) > 0 {
100+ return bytesStdout, nil
102+ return bytes.TrimSpace(stderr.Bytes()), nil
105+type executableSubjectProvider struct {
107+ Timeout time.Duration
114+type executableResponse struct {
115+ Version int `json:"version,omitempty"`
116+ Success *bool `json:"success,omitempty"`
117+ TokenType string `json:"token_type,omitempty"`
118+ ExpirationTime int64 `json:"expiration_time,omitempty"`
119+ IDToken string `json:"id_token,omitempty"`
120+ SamlResponse string `json:"saml_response,omitempty"`
121+ Code string `json:"code,omitempty"`
122+ Message string `json:"message,omitempty"`
125+func (sp *executableSubjectProvider) parseSubjectTokenFromSource(response []byte, source string, now int64) (string, error) {
126+ var result executableResponse
127+ if err := json.Unmarshal(response, &result); err != nil {
128+ return "", jsonParsingError(source, string(response))
131+ if result.Version == 0 {
132+ return "", missingFieldError(source, "version")
134+ if result.Success == nil {
135+ return "", missingFieldError(source, "success")
137+ if !*result.Success {
138+ if result.Code == "" || result.Message == "" {
139+ return "", malformedFailureError()
141+ return "", userDefinedError(result.Code, result.Message)
143+ if result.Version > executableSupportedMaxVersion || result.Version < 0 {
144+ return "", unsupportedVersionError(source, result.Version)
146+ if result.ExpirationTime == 0 && sp.OutputFile != "" {
147+ return "", missingFieldError(source, "expiration_time")
149+ if result.TokenType == "" {
150+ return "", missingFieldError(source, "token_type")
152+ if result.ExpirationTime != 0 && result.ExpirationTime < now {
153+ return "", tokenExpiredError()
156+ switch result.TokenType {
157+ case jwtTokenType, idTokenType:
158+ if result.IDToken == "" {
159+ return "", missingFieldError(source, "id_token")
161+ return result.IDToken, nil
162+ case saml2TokenType:
163+ if result.SamlResponse == "" {
164+ return "", missingFieldError(source, "saml_response")
166+ return result.SamlResponse, nil
168+ return "", tokenTypeError(source)
172+func (sp *executableSubjectProvider) subjectToken(ctx context.Context) (string, error) {
173+ if token, err := sp.getTokenFromOutputFile(); token != "" || err != nil {
176+ return sp.getTokenFromExecutableCommand(ctx)
179+func (sp *executableSubjectProvider) providerType() string {
180+ return executableProviderType
183+func (sp *executableSubjectProvider) getTokenFromOutputFile() (token string, err error) {
184+ if sp.OutputFile == "" {
185+ // This ExecutableCredentialSource doesn't use an OutputFile.
189+ file, err := os.Open(sp.OutputFile)
191+ // No OutputFile found. Hasn't been created yet, so skip it.
196+ data, err := internal.ReadAll(file)
197+ if err != nil || len(data) == 0 {
198+ // Cachefile exists, but no data found. Get new credential.
202+ token, err = sp.parseSubjectTokenFromSource(data, outputFileSource, sp.env.now().Unix())
204+ if _, ok := err.(nonCacheableError); ok {
205+ // If the cached token is expired we need a new token,
206+ // and if the cache contains a failure, we need to try again.
210+ // There was an error in the cached token, and the developer should be aware of it.
213+ // Token parsing succeeded. Use found token.
217+func (sp *executableSubjectProvider) executableEnvironment() []string {
218+ result := sp.env.existingEnv()
219+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE=%v", sp.opts.Audience))
220+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE=%v", sp.opts.SubjectTokenType))
221+ result = append(result, "GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE=0")
222+ if sp.opts.ServiceAccountImpersonationURL != "" {
223+ matches := serviceAccountImpersonationRE.FindStringSubmatch(sp.opts.ServiceAccountImpersonationURL)
225+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL=%v", matches[1]))
228+ if sp.OutputFile != "" {
229+ result = append(result, fmt.Sprintf("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE=%v", sp.OutputFile))
234+func (sp *executableSubjectProvider) getTokenFromExecutableCommand(ctx context.Context) (string, error) {
235+ // For security reasons, we need our consumers to set this environment variable to allow executables to be run.
236+ if sp.env.getenv(allowExecutablesEnvVar) != "1" {
237+ return "", errors.New("credentials: executables need to be explicitly allowed (set GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES to '1') to run")
240+ ctx, cancel := context.WithDeadline(ctx, sp.env.now().Add(sp.Timeout))
243+ output, err := sp.env.run(ctx, sp.Command, sp.executableEnvironment())
247+ return sp.parseSubjectTokenFromSource(output, executableSource, sp.env.now().Unix())
250+func missingFieldError(source, field string) error {
251+ return fmt.Errorf("credentials: %q missing %q field", source, field)
254+func jsonParsingError(source, data string) error {
255+ return fmt.Errorf("credentials: unable to parse %q: %v", source, data)
258+func malformedFailureError() error {
259+ return nonCacheableError{"credentials: response must include `error` and `message` fields when unsuccessful"}
262+func userDefinedError(code, message string) error {
263+ return nonCacheableError{fmt.Sprintf("credentials: response contains unsuccessful response: (%v) %v", code, message)}
266+func unsupportedVersionError(source string, version int) error {
267+ return fmt.Errorf("credentials: %v contains unsupported version: %v", source, version)
270+func tokenExpiredError() error {
271+ return nonCacheableError{"credentials: the token returned by the executable is expired"}
274+func tokenTypeError(source string) error {
275+ return fmt.Errorf("credentials: %v contains unsupported token type", source)
278+func exitCodeError(err *exec.ExitError) error {
279+ return fmt.Errorf("credentials: executable command failed with exit code %v: %w", err.ExitCode(), err)
282+func executableError(err error) error {
283+ return fmt.Errorf("credentials: executable command failed: %w", err)
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.gonew file+428
@@ -0,0 +1,428 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
28+ "cloud.google.com/go/auth"
29+ "cloud.google.com/go/auth/credentials/internal/impersonate"
30+ "cloud.google.com/go/auth/credentials/internal/stsexchange"
31+ "cloud.google.com/go/auth/internal/credsfile"
32+ "github.com/googleapis/gax-go/v2/internallog"
36+ timeoutMinimum = 5 * time.Second
37+ timeoutMaximum = 120 * time.Second
39+ universeDomainPlaceholder = "UNIVERSE_DOMAIN"
40+ defaultTokenURL = "https://sts.UNIVERSE_DOMAIN/v1/token"
41+ defaultUniverseDomain = "googleapis.com"
45+ // Now aliases time.Now for testing
46+ Now = func() time.Time {
47+ return time.Now().UTC()
49+ validWorkforceAudiencePattern *regexp.Regexp = regexp.MustCompile(`//iam\.googleapis\.com/locations/[^/]+/workforcePools/`)
52+// Options stores the configuration for fetching tokens with external credentials.
54+ // Audience is the Secure Token Service (STS) audience which contains the resource name for the workload
55+ // identity pool or the workforce pool and the provider identifier in that pool.
57+ // SubjectTokenType is the STS token type based on the Oauth2.0 token exchange spec
58+ // e.g. `urn:ietf:params:oauth:token-type:jwt`.
59+ SubjectTokenType string
60+ // TokenURL is the STS token exchange endpoint.
62+ // TokenInfoURL is the token_info endpoint used to retrieve the account related information (
63+ // user attributes like account identifier, eg. email, username, uid, etc). This is
64+ // needed for gCloud session account identification.
66+ // ServiceAccountImpersonationURL is the URL for the service account impersonation request. This is only
67+ // required for workload identity pools when APIs to be accessed have not integrated with UberMint.
68+ ServiceAccountImpersonationURL string
69+ // ServiceAccountImpersonationLifetimeSeconds is the number of seconds the service account impersonation
70+ // token will be valid for.
71+ ServiceAccountImpersonationLifetimeSeconds int
72+ // ClientSecret is currently only required if token_info endpoint also
73+ // needs to be called with the generated GCP access token. When provided, STS will be
74+ // called with additional basic authentication using client_id as username and client_secret as password.
76+ // ClientID is only required in conjunction with ClientSecret, as described above.
78+ // CredentialSource contains the necessary information to retrieve the token itself, as well
79+ // as some environmental information.
80+ CredentialSource *credsfile.CredentialSource
81+ // QuotaProjectID is injected by gCloud. If the value is non-empty, the Auth libraries
82+ // will set the x-goog-user-project which overrides the project associated with the credentials.
83+ QuotaProjectID string
84+ // Scopes contains the desired scopes for the returned access token.
86+ // WorkforcePoolUserProject should be set when it is a workforce pool and
87+ // not a workload identity pool. The underlying principal must still have
88+ // serviceusage.services.use IAM permission to use the project for
89+ // billing/quota. Optional.
90+ WorkforcePoolUserProject string
91+ // UniverseDomain is the default service domain for a given Cloud universe.
92+ // This value will be used in the default STS token URL. The default value
93+ // is "googleapis.com". It will not be used if TokenURL is set. Optional.
94+ UniverseDomain string
95+ // SubjectTokenProvider is an optional token provider for OIDC/SAML
96+ // credentials. One of SubjectTokenProvider, AWSSecurityCredentialProvider
97+ // or CredentialSource must be provided. Optional.
98+ SubjectTokenProvider SubjectTokenProvider
99+ // AwsSecurityCredentialsProvider is an AWS Security Credential provider
100+ // for AWS credentials. One of SubjectTokenProvider,
101+ // AWSSecurityCredentialProvider or CredentialSource must be provided. Optional.
102+ AwsSecurityCredentialsProvider AwsSecurityCredentialsProvider
103+ // Client for token request.
105+ // IsDefaultClient marks whether the client passed in is a default client that can be overriden.
106+ // This is important for X509 credentials which should create a new client if the default was used
107+ // but should respect a client explicitly passed in by the user.
108+ IsDefaultClient bool
109+ // Logger is used for debug logging. If provided, logging will be enabled
110+ // at the loggers configured level. By default logging is disabled unless
111+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
112+ // logger will be used. Optional.
116+// SubjectTokenProvider can be used to supply a subject token to exchange for a
118+type SubjectTokenProvider interface {
119+ // SubjectToken should return a valid subject token or an error.
120+ // The external account token provider does not cache the returned subject
121+ // token, so caching logic should be implemented in the provider to prevent
122+ // multiple requests for the same subject token.
123+ SubjectToken(ctx context.Context, opts *RequestOptions) (string, error)
126+// RequestOptions contains information about the requested subject token or AWS
127+// security credentials from the Google external account credential.
128+type RequestOptions struct {
129+ // Audience is the requested audience for the external account credential.
131+ // Subject token type is the requested subject token type for the external
132+ // account credential. Expected values include:
133+ // “urn:ietf:params:oauth:token-type:jwt”
134+ // “urn:ietf:params:oauth:token-type:id-token”
135+ // “urn:ietf:params:oauth:token-type:saml2”
136+ // “urn:ietf:params:aws:token-type:aws4_request”
137+ SubjectTokenType string
140+// AwsSecurityCredentialsProvider can be used to supply AwsSecurityCredentials
141+// and an AWS Region to exchange for a GCP access token.
142+type AwsSecurityCredentialsProvider interface {
143+ // AwsRegion should return the AWS region or an error.
144+ AwsRegion(ctx context.Context, opts *RequestOptions) (string, error)
145+ // GetAwsSecurityCredentials should return a valid set of
146+ // AwsSecurityCredentials or an error. The external account token provider
147+ // does not cache the returned security credentials, so caching logic should
148+ // be implemented in the provider to prevent multiple requests for the
149+ // same security credentials.
150+ AwsSecurityCredentials(ctx context.Context, opts *RequestOptions) (*AwsSecurityCredentials, error)
153+// AwsSecurityCredentials models AWS security credentials.
154+type AwsSecurityCredentials struct {
155+ // AccessKeyId is the AWS Access Key ID - Required.
156+ AccessKeyID string `json:"AccessKeyID"`
157+ // SecretAccessKey is the AWS Secret Access Key - Required.
158+ SecretAccessKey string `json:"SecretAccessKey"`
159+ // SessionToken is the AWS Session token. This should be provided for
160+ // temporary AWS security credentials - Optional.
161+ SessionToken string `json:"Token"`
164+func (o *Options) validate() error {
165+ if o.Audience == "" {
166+ return fmt.Errorf("externalaccount: Audience must be set")
168+ if o.SubjectTokenType == "" {
169+ return fmt.Errorf("externalaccount: Subject token type must be set")
171+ if o.WorkforcePoolUserProject != "" {
172+ if valid := validWorkforceAudiencePattern.MatchString(o.Audience); !valid {
173+ return fmt.Errorf("externalaccount: workforce_pool_user_project should not be set for non-workforce pool credentials")
177+ if o.CredentialSource != nil {
180+ if o.SubjectTokenProvider != nil {
183+ if o.AwsSecurityCredentialsProvider != nil {
187+ return fmt.Errorf("externalaccount: one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set")
190+ return fmt.Errorf("externalaccount: only one of CredentialSource, SubjectTokenProvider, or AwsSecurityCredentialsProvider must be set")
195+// client returns the http client that should be used for the token exchange. If a non-default client
196+// is provided, then the client configured in the options will always be returned. If a default client
197+// is provided and the options are configured for X509 credentials, a new client will be created.
198+func (o *Options) client() (*http.Client, error) {
199+ // If a client was provided and no override certificate config location was provided, use the provided client.
200+ if o.CredentialSource == nil || o.CredentialSource.Certificate == nil || (!o.IsDefaultClient && o.CredentialSource.Certificate.CertificateConfigLocation == "") {
201+ return o.Client, nil
204+ // If a new client should be created, validate and use the certificate source to create a new mTLS client.
205+ cert := o.CredentialSource.Certificate
206+ if !cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation == "" {
207+ return nil, errors.New("credentials: \"certificate\" object must either specify a certificate_config_location or use_default_certificate_config should be true")
209+ if cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation != "" {
210+ return nil, errors.New("credentials: \"certificate\" object cannot specify both a certificate_config_location and use_default_certificate_config=true")
212+ return createX509Client(cert.CertificateConfigLocation)
215+// resolveTokenURL sets the default STS token endpoint with the configured
217+func (o *Options) resolveTokenURL() {
218+ if o.TokenURL != "" {
220+ } else if o.UniverseDomain != "" {
221+ o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, o.UniverseDomain, 1)
223+ o.TokenURL = strings.Replace(defaultTokenURL, universeDomainPlaceholder, defaultUniverseDomain, 1)
227+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider]
228+// configured with the provided options.
229+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
230+ if err := opts.validate(); err != nil {
233+ opts.resolveTokenURL()
234+ logger := internallog.New(opts.Logger)
235+ stp, err := newSubjectTokenProvider(opts)
240+ client, err := opts.client()
245+ tp := &tokenProvider{
252+ if opts.ServiceAccountImpersonationURL == "" {
253+ return auth.NewCachedTokenProvider(tp, nil), nil
256+ scopes := make([]string, len(opts.Scopes))
257+ copy(scopes, opts.Scopes)
258+ // needed for impersonation
259+ tp.opts.Scopes = []string{"https://www.googleapis.com/auth/cloud-platform"}
260+ imp, err := impersonate.NewTokenProvider(&impersonate.Options{
262+ URL: opts.ServiceAccountImpersonationURL,
264+ Tp: auth.NewCachedTokenProvider(tp, nil),
265+ TokenLifetimeSeconds: opts.ServiceAccountImpersonationLifetimeSeconds,
271+ return auth.NewCachedTokenProvider(imp, nil), nil
274+type subjectTokenProvider interface {
275+ subjectToken(ctx context.Context) (string, error)
276+ providerType() string
279+// tokenProvider is the provider that handles external credentials. It is used to retrieve Tokens.
280+type tokenProvider struct {
284+ stp subjectTokenProvider
287+func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) {
288+ subjectToken, err := tp.stp.subjectToken(ctx)
293+ stsRequest := &stsexchange.TokenRequest{
294+ GrantType: stsexchange.GrantType,
295+ Audience: tp.opts.Audience,
296+ Scope: tp.opts.Scopes,
297+ RequestedTokenType: stsexchange.TokenType,
298+ SubjectToken: subjectToken,
299+ SubjectTokenType: tp.opts.SubjectTokenType,
301+ header := make(http.Header)
302+ header.Set("Content-Type", "application/x-www-form-urlencoded")
303+ header.Add("x-goog-api-client", getGoogHeaderValue(tp.opts, tp.stp))
304+ clientAuth := stsexchange.ClientAuthentication{
305+ AuthStyle: auth.StyleInHeader,
306+ ClientID: tp.opts.ClientID,
307+ ClientSecret: tp.opts.ClientSecret,
309+ var options map[string]interface{}
310+ // Do not pass workforce_pool_user_project when client authentication is used.
311+ // The client ID is sufficient for determining the user project.
312+ if tp.opts.WorkforcePoolUserProject != "" && tp.opts.ClientID == "" {
313+ options = map[string]interface{}{
314+ "userProject": tp.opts.WorkforcePoolUserProject,
317+ stsResp, err := stsexchange.ExchangeToken(ctx, &stsexchange.Options{
319+ Endpoint: tp.opts.TokenURL,
320+ Request: stsRequest,
321+ Authentication: clientAuth,
331+ Value: stsResp.AccessToken,
332+ Type: stsResp.TokenType,
334+ // The RFC8693 doesn't define the explicit 0 of "expires_in" field behavior.
335+ if stsResp.ExpiresIn <= 0 {
336+ return nil, fmt.Errorf("credentials: got invalid expiry from security token service")
338+ tok.Expiry = Now().Add(time.Duration(stsResp.ExpiresIn) * time.Second)
342+// newSubjectTokenProvider determines the type of credsfile.CredentialSource needed to create a
343+// subjectTokenProvider
344+func newSubjectTokenProvider(o *Options) (subjectTokenProvider, error) {
345+ logger := internallog.New(o.Logger)
346+ reqOpts := &RequestOptions{Audience: o.Audience, SubjectTokenType: o.SubjectTokenType}
347+ if o.AwsSecurityCredentialsProvider != nil {
348+ return &awsSubjectProvider{
349+ securityCredentialsProvider: o.AwsSecurityCredentialsProvider,
350+ TargetResource: o.Audience,
354+ } else if o.SubjectTokenProvider != nil {
355+ return &programmaticProvider{stp: o.SubjectTokenProvider, opts: reqOpts}, nil
356+ } else if len(o.CredentialSource.EnvironmentID) > 3 && o.CredentialSource.EnvironmentID[:3] == "aws" {
357+ if awsVersion, err := strconv.Atoi(o.CredentialSource.EnvironmentID[3:]); err == nil {
358+ if awsVersion != 1 {
359+ return nil, fmt.Errorf("credentials: aws version '%d' is not supported in the current build", awsVersion)
362+ awsProvider := &awsSubjectProvider{
363+ EnvironmentID: o.CredentialSource.EnvironmentID,
364+ RegionURL: o.CredentialSource.RegionURL,
365+ RegionalCredVerificationURL: o.CredentialSource.RegionalCredVerificationURL,
366+ CredVerificationURL: o.CredentialSource.URL,
367+ TargetResource: o.Audience,
371+ if o.CredentialSource.IMDSv2SessionTokenURL != "" {
372+ awsProvider.IMDSv2SessionTokenURL = o.CredentialSource.IMDSv2SessionTokenURL
375+ return awsProvider, nil
377+ } else if o.CredentialSource.File != "" {
378+ return &fileSubjectProvider{File: o.CredentialSource.File, Format: o.CredentialSource.Format}, nil
379+ } else if o.CredentialSource.URL != "" {
380+ return &urlSubjectProvider{
381+ URL: o.CredentialSource.URL,
382+ Headers: o.CredentialSource.Headers,
383+ Format: o.CredentialSource.Format,
387+ } else if o.CredentialSource.Executable != nil {
388+ ec := o.CredentialSource.Executable
389+ if ec.Command == "" {
390+ return nil, errors.New("credentials: missing `command` field — executable command must be provided")
393+ execProvider := &executableSubjectProvider{}
394+ execProvider.Command = ec.Command
395+ if ec.TimeoutMillis == 0 {
396+ execProvider.Timeout = executableDefaultTimeout
398+ execProvider.Timeout = time.Duration(ec.TimeoutMillis) * time.Millisecond
399+ if execProvider.Timeout < timeoutMinimum || execProvider.Timeout > timeoutMaximum {
400+ return nil, fmt.Errorf("credentials: invalid `timeout_millis` field — executable timeout must be between %v and %v seconds", timeoutMinimum.Seconds(), timeoutMaximum.Seconds())
403+ execProvider.OutputFile = ec.OutputFile
404+ execProvider.client = o.Client
405+ execProvider.opts = o
406+ execProvider.env = runtimeEnvironment{}
407+ return execProvider, nil
408+ } else if o.CredentialSource.Certificate != nil {
409+ cert := o.CredentialSource.Certificate
410+ if !cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation == "" {
411+ return nil, errors.New("credentials: \"certificate\" object must either specify a certificate_config_location or use_default_certificate_config should be true")
413+ if cert.UseDefaultCertificateConfig && cert.CertificateConfigLocation != "" {
414+ return nil, errors.New("credentials: \"certificate\" object cannot specify both a certificate_config_location and use_default_certificate_config=true")
416+ return &x509Provider{}, nil
418+ return nil, errors.New("credentials: unable to parse credential source")
421+func getGoogHeaderValue(conf *Options, p subjectTokenProvider) string {
422+ return fmt.Sprintf("gl-go/%s auth/%s google-byoid-sdk source/%s sa-impersonation/%t config-lifetime/%t",
426+ conf.ServiceAccountImpersonationURL != "",
427+ conf.ServiceAccountImpersonationLifetimeSeconds != 0)
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/file_provider.gonew file+78
@@ -0,0 +1,78 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
25+ "cloud.google.com/go/auth/internal"
26+ "cloud.google.com/go/auth/internal/credsfile"
30+ fileProviderType = "file"
33+type fileSubjectProvider struct {
35+ Format *credsfile.Format
38+func (sp *fileSubjectProvider) subjectToken(context.Context) (string, error) {
39+ tokenFile, err := os.Open(sp.File)
41+ return "", fmt.Errorf("credentials: failed to open credential file %q: %w", sp.File, err)
43+ defer tokenFile.Close()
44+ tokenBytes, err := internal.ReadAll(tokenFile)
46+ return "", fmt.Errorf("credentials: failed to read credential file: %w", err)
48+ tokenBytes = bytes.TrimSpace(tokenBytes)
50+ if sp.Format == nil {
51+ return string(tokenBytes), nil
53+ switch sp.Format.Type {
55+ jsonData := make(map[string]interface{})
56+ err = json.Unmarshal(tokenBytes, &jsonData)
58+ return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err)
60+ val, ok := jsonData[sp.Format.SubjectTokenFieldName]
62+ return "", errors.New("credentials: provided subject_token_field_name not found in credentials")
64+ token, ok := val.(string)
66+ return "", errors.New("credentials: improperly formatted subject token")
70+ return string(tokenBytes), nil
72+ return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type)
76+func (sp *fileSubjectProvider) providerType() string {
77+ return fileProviderType
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/info.gonew file+74
@@ -0,0 +1,74 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
24+ // version is a package internal global variable for testing purposes.
25+ version = runtime.Version
28+// versionUnknown is only used when the runtime version cannot be determined.
29+const versionUnknown = "UNKNOWN"
31+// goVersion returns a Go runtime version derived from the runtime environment
32+// that is modified to be suitable for reporting in a header, meaning it has no
33+// whitespace. If it is unable to determine the Go runtime version, it returns
35+func goVersion() string {
36+ const develPrefix = "devel +"
39+ if strings.HasPrefix(s, develPrefix) {
40+ s = s[len(develPrefix):]
41+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
45+ } else if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
49+ notSemverRune := func(r rune) bool {
50+ return !strings.ContainsRune("0123456789.", r)
53+ if strings.HasPrefix(s, "go1") {
55+ var prerelease string
56+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
57+ s, prerelease = s[:p], s[p:]
59+ if strings.HasSuffix(s, ".") {
61+ } else if strings.Count(s, ".") < 2 {
64+ if prerelease != "" {
65+ // Some release candidates already have a dash in them.
66+ if !strings.HasPrefix(prerelease, "-") {
67+ prerelease = "-" + prerelease
73+ return versionUnknown
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/programmatic_provider.gonew file+30
@@ -0,0 +1,30 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
19+type programmaticProvider struct {
21+ stp SubjectTokenProvider
24+func (pp *programmaticProvider) providerType() string {
25+ return programmaticProviderType
28+func (pp *programmaticProvider) subjectToken(ctx context.Context) (string, error) {
29+ return pp.stp.SubjectToken(ctx, pp.opts)
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/url_provider.gonew file+93
@@ -0,0 +1,93 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
25+ "cloud.google.com/go/auth/internal"
26+ "cloud.google.com/go/auth/internal/credsfile"
27+ "github.com/googleapis/gax-go/v2/internallog"
31+ fileTypeText = "text"
32+ fileTypeJSON = "json"
33+ urlProviderType = "url"
34+ programmaticProviderType = "programmatic"
35+ x509ProviderType = "x509"
38+type urlSubjectProvider struct {
40+ Headers map[string]string
41+ Format *credsfile.Format
46+func (sp *urlSubjectProvider) subjectToken(ctx context.Context) (string, error) {
47+ req, err := http.NewRequestWithContext(ctx, "GET", sp.URL, nil)
49+ return "", fmt.Errorf("credentials: HTTP request for URL-sourced credential failed: %w", err)
52+ for key, val := range sp.Headers {
53+ req.Header.Add(key, val)
55+ sp.Logger.DebugContext(ctx, "url subject token request", "request", internallog.HTTPRequest(req, nil))
56+ resp, body, err := internal.DoRequest(sp.Client, req)
58+ return "", fmt.Errorf("credentials: invalid response when retrieving subject token: %w", err)
60+ sp.Logger.DebugContext(ctx, "url subject token response", "response", internallog.HTTPResponse(resp, body))
61+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
62+ return "", fmt.Errorf("credentials: status code %d: %s", c, body)
65+ if sp.Format == nil {
66+ return string(body), nil
68+ switch sp.Format.Type {
70+ jsonData := make(map[string]interface{})
71+ err = json.Unmarshal(body, &jsonData)
73+ return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err)
75+ val, ok := jsonData[sp.Format.SubjectTokenFieldName]
77+ return "", errors.New("credentials: provided subject_token_field_name not found in credentials")
79+ token, ok := val.(string)
81+ return "", errors.New("credentials: improperly formatted subject token")
85+ return string(body), nil
87+ return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type)
91+func (sp *urlSubjectProvider) providerType() string {
92+ return urlProviderType
vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/x509_provider.gonew file+63
@@ -0,0 +1,63 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccount
23+ "cloud.google.com/go/auth/internal/transport/cert"
26+// x509Provider implements the subjectTokenProvider type for
27+// x509 workload identity credentials. Because x509 credentials
28+// rely on an mTLS connection to represent the 3rd party identity
29+// rather than a subject token, this provider will always return
30+// an empty string when a subject token is requested by the external account
32+type x509Provider struct {
35+func (xp *x509Provider) providerType() string {
36+ return x509ProviderType
39+func (xp *x509Provider) subjectToken(ctx context.Context) (string, error) {
43+// createX509Client creates a new client that is configured with mTLS, using the
44+// certificate configuration specified in the credential source.
45+func createX509Client(certificateConfigLocation string) (*http.Client, error) {
46+ certProvider, err := cert.NewWorkloadX509CertProvider(certificateConfigLocation)
50+ trans := http.DefaultTransport.(*http.Transport).Clone()
52+ trans.TLSClientConfig = &tls.Config{
53+ GetClientCertificate: certProvider,
56+ // Create a client with default settings plus the X509 workload cert and key.
57+ client := &http.Client{
59+ Timeout: 30 * time.Second,
vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.gonew file+115
@@ -0,0 +1,115 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+package externalaccountuser
24+ "cloud.google.com/go/auth"
25+ "cloud.google.com/go/auth/credentials/internal/stsexchange"
26+ "cloud.google.com/go/auth/internal"
27+ "github.com/googleapis/gax-go/v2/internallog"
30+// Options stores the configuration for fetching tokens with external authorized
33+ // Audience is the Secure Token Service (STS) audience which contains the
34+ // resource name for the workforce pool and the provider identifier in that
37+ // RefreshToken is the OAuth 2.0 refresh token.
39+ // TokenURL is the STS token exchange endpoint for refresh.
41+ // TokenInfoURL is the STS endpoint URL for token introspection. Optional.
43+ // ClientID is only required in conjunction with ClientSecret, as described
46+ // ClientSecret is currently only required if token_info endpoint also needs
47+ // to be called with the generated a cloud access token. When provided, STS
48+ // will be called with additional basic authentication using client_id as
49+ // username and client_secret as password.
51+ // Scopes contains the desired scopes for the returned access token.
54+ // Client for token request.
56+ // Logger for logging.
60+func (c *Options) validate() bool {
61+ return c.ClientID != "" && c.ClientSecret != "" && c.RefreshToken != "" && c.TokenURL != ""
64+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider]
65+// configured with the provided options.
66+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
67+ if !opts.validate() {
68+ return nil, errors.New("credentials: invalid external_account_authorized_user configuration")
71+ tp := &tokenProvider{
74+ return auth.NewCachedTokenProvider(tp, nil), nil
77+type tokenProvider struct {
81+func (tp *tokenProvider) Token(ctx context.Context) (*auth.Token, error) {
84+ clientAuth := stsexchange.ClientAuthentication{
85+ AuthStyle: auth.StyleInHeader,
86+ ClientID: opts.ClientID,
87+ ClientSecret: opts.ClientSecret,
89+ headers := make(http.Header)
90+ headers.Set("Content-Type", "application/x-www-form-urlencoded")
91+ stsResponse, err := stsexchange.RefreshAccessToken(ctx, &stsexchange.Options{
93+ Endpoint: opts.TokenURL,
94+ RefreshToken: opts.RefreshToken,
95+ Authentication: clientAuth,
97+ Logger: internallog.New(tp.o.Logger),
102+ if stsResponse.ExpiresIn < 0 {
103+ return nil, errors.New("credentials: invalid expiry from security token service")
106+ // guarded by the wrapping with CachedTokenProvider
107+ if stsResponse.RefreshToken != "" {
108+ opts.RefreshToken = stsResponse.RefreshToken
111+ Value: stsResponse.AccessToken,
112+ Expiry: time.Now().UTC().Add(time.Duration(stsResponse.ExpiresIn) * time.Second),
113+ Type: internal.TokenTypeBearer,
vendor/cloud.google.com/go/auth/credentials/internal/gdch/gdch.gonew file+191
@@ -0,0 +1,191 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
32+ "cloud.google.com/go/auth"
33+ "cloud.google.com/go/auth/internal"
34+ "cloud.google.com/go/auth/internal/credsfile"
35+ "cloud.google.com/go/auth/internal/jwt"
36+ "github.com/googleapis/gax-go/v2/internallog"
40+ // GrantType is the grant type for the token request.
41+ GrantType = "urn:ietf:params:oauth:token-type:token-exchange"
42+ requestTokenType = "urn:ietf:params:oauth:token-type:access_token"
43+ subjectTokenType = "urn:k8s:params:oauth:token-type:serviceaccount"
47+ gdchSupportFormatVersions map[string]bool = map[string]bool{
52+// Options for [NewTokenProvider].
59+// NewTokenProvider returns a [cloud.google.com/go/auth.TokenProvider] from a
61+func NewTokenProvider(f *credsfile.GDCHServiceAccountFile, o *Options) (auth.TokenProvider, error) {
62+ if !gdchSupportFormatVersions[f.FormatVersion] {
63+ return nil, fmt.Errorf("credentials: unsupported gdch_service_account format %q", f.FormatVersion)
65+ if o.STSAudience == "" {
66+ return nil, errors.New("credentials: STSAudience must be set for the GDCH auth flows")
68+ signer, err := internal.ParseKey([]byte(f.PrivateKey))
72+ certPool, err := loadCertPool(f.CertPath)
78+ serviceIdentity: fmt.Sprintf("system:serviceaccount:%s:%s", f.Project, f.Name),
79+ tokenURL: f.TokenURL,
82+ pkID: f.PrivateKeyID,
85+ logger: internallog.New(o.Logger),
90+func loadCertPool(path string) (*x509.CertPool, error) {
91+ pool := x509.NewCertPool()
92+ pem, err := os.ReadFile(path)
94+ return nil, fmt.Errorf("credentials: failed to read certificate: %w", err)
96+ pool.AppendCertsFromPEM(pem)
100+type gdchProvider struct {
101+ serviceIdentity string
104+ signer crypto.Signer
106+ certPool *x509.CertPool
112+func (g gdchProvider) Token(ctx context.Context) (*auth.Token, error) {
113+ addCertToTransport(g.client, g.certPool)
115+ exp := iat.Add(time.Hour)
116+ claims := jwt.Claims{
117+ Iss: g.serviceIdentity,
118+ Sub: g.serviceIdentity,
124+ Algorithm: jwt.HeaderAlgRSA256,
125+ Type: jwt.HeaderType,
126+ KeyID: string(g.pkID),
128+ payload, err := jwt.EncodeJWS(&h, &claims, g.signer)
133+ v.Set("grant_type", GrantType)
134+ v.Set("audience", g.aud)
135+ v.Set("requested_token_type", requestTokenType)
136+ v.Set("subject_token", payload)
137+ v.Set("subject_token_type", subjectTokenType)
139+ req, err := http.NewRequestWithContext(ctx, "POST", g.tokenURL, strings.NewReader(v.Encode()))
143+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
144+ g.logger.DebugContext(ctx, "gdch token request", "request", internallog.HTTPRequest(req, []byte(v.Encode())))
145+ resp, body, err := internal.DoRequest(g.client, req)
147+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
149+ g.logger.DebugContext(ctx, "gdch token response", "response", internallog.HTTPResponse(resp, body))
150+ if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices {
151+ return nil, &auth.Error{
157+ var tokenRes struct {
158+ AccessToken string `json:"access_token"`
159+ TokenType string `json:"token_type"`
160+ ExpiresIn int64 `json:"expires_in"` // relative seconds from now
162+ if err := json.Unmarshal(body, &tokenRes); err != nil {
163+ return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
165+ token := &auth.Token{
166+ Value: tokenRes.AccessToken,
167+ Type: tokenRes.TokenType,
169+ raw := make(map[string]interface{})
170+ json.Unmarshal(body, &raw) // no error checks for optional fields
171+ token.Metadata = raw
173+ if secs := tokenRes.ExpiresIn; secs > 0 {
174+ token.Expiry = time.Now().Add(time.Duration(secs) * time.Second)
179+// addCertToTransport makes a best effort attempt at adding in the cert info to
180+// the client. It tries to keep all configured transport settings if the
181+// underlying transport is an http.Transport. Or else it overwrites the
182+// transport with defaults adding in the certs.
183+func addCertToTransport(hc *http.Client, certPool *x509.CertPool) {
184+ trans, ok := hc.Transport.(*http.Transport)
186+ trans = http.DefaultTransport.(*http.Transport).Clone()
188+ trans.TLSClientConfig = &tls.Config{
vendor/cloud.google.com/go/auth/credentials/internal/impersonate/impersonate.gonew file+156
@@ -0,0 +1,156 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
27+ "cloud.google.com/go/auth"
28+ "cloud.google.com/go/auth/internal"
29+ "github.com/googleapis/gax-go/v2/internallog"
33+ defaultTokenLifetime = "3600s"
34+ authHeaderKey = "Authorization"
37+// generateAccesstokenReq is used for service account impersonation
38+type generateAccessTokenReq struct {
39+ Delegates []string `json:"delegates,omitempty"`
40+ Lifetime string `json:"lifetime,omitempty"`
41+ Scope []string `json:"scope,omitempty"`
44+type impersonateTokenResponse struct {
45+ AccessToken string `json:"accessToken"`
46+ ExpireTime string `json:"expireTime"`
49+// NewTokenProvider uses a source credential, stored in Ts, to request an access token to the provided URL.
50+// Scopes can be defined when the access token is requested.
51+func NewTokenProvider(opts *Options) (auth.TokenProvider, error) {
52+ if err := opts.validate(); err != nil {
58+// Options for [NewTokenProvider].
60+ // Tp is the source credential used to generate a token on the
61+ // impersonated service account. Required.
62+ Tp auth.TokenProvider
64+ // URL is the endpoint to call to generate a token
65+ // on behalf of the service account. Required.
67+ // Scopes that the impersonated credential should have. Required.
69+ // Delegates are the service account email addresses in a delegation chain.
70+ // Each service account must be granted roles/iam.serviceAccountTokenCreator
71+ // on the next service account in the chain. Optional.
73+ // TokenLifetimeSeconds is the number of seconds the impersonation token will
74+ // be valid for. Defaults to 1 hour if unset. Optional.
75+ TokenLifetimeSeconds int
76+ // Client configures the underlying client used to make network requests
77+ // when fetching tokens. Required.
79+ // Logger is used for debug logging. If provided, logging will be enabled
80+ // at the loggers configured level. By default logging is disabled unless
81+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
82+ // logger will be used. Optional.
86+func (o *Options) validate() error {
88+ return errors.New("credentials: missing required 'source_credentials' field in impersonated credentials")
91+ return errors.New("credentials: missing required 'service_account_impersonation_url' field in impersonated credentials")
96+// Token performs the exchange to get a temporary service account token to allow access to GCP.
97+func (o *Options) Token(ctx context.Context) (*auth.Token, error) {
98+ logger := internallog.New(o.Logger)
99+ lifetime := defaultTokenLifetime
100+ if o.TokenLifetimeSeconds != 0 {
101+ lifetime = fmt.Sprintf("%ds", o.TokenLifetimeSeconds)
103+ reqBody := generateAccessTokenReq{
106+ Delegates: o.Delegates,
108+ b, err := json.Marshal(reqBody)
110+ return nil, fmt.Errorf("credentials: unable to marshal request: %w", err)
112+ req, err := http.NewRequestWithContext(ctx, "POST", o.URL, bytes.NewReader(b))
114+ return nil, fmt.Errorf("credentials: unable to create impersonation request: %w", err)
116+ req.Header.Set("Content-Type", "application/json")
117+ if err := setAuthHeader(ctx, o.Tp, req); err != nil {
120+ logger.DebugContext(ctx, "impersonated token request", "request", internallog.HTTPRequest(req, b))
121+ resp, body, err := internal.DoRequest(o.Client, req)
123+ return nil, fmt.Errorf("credentials: unable to generate access token: %w", err)
125+ logger.DebugContext(ctx, "impersonated token response", "response", internallog.HTTPResponse(resp, body))
126+ if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
127+ return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
130+ var accessTokenResp impersonateTokenResponse
131+ if err := json.Unmarshal(body, &accessTokenResp); err != nil {
132+ return nil, fmt.Errorf("credentials: unable to parse response: %w", err)
134+ expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime)
136+ return nil, fmt.Errorf("credentials: unable to parse expiry: %w", err)
139+ Value: accessTokenResp.AccessToken,
141+ Type: internal.TokenTypeBearer,
145+func setAuthHeader(ctx context.Context, tp auth.TokenProvider, r *http.Request) error {
146+ t, err := tp.Token(ctx)
152+ typ = internal.TokenTypeBearer
154+ r.Header.Set(authHeaderKey, typ+" "+t.Value)
vendor/cloud.google.com/go/auth/credentials/internal/stsexchange/sts_exchange.gonew file+167
@@ -0,0 +1,167 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
28+ "cloud.google.com/go/auth"
29+ "cloud.google.com/go/auth/internal"
30+ "github.com/googleapis/gax-go/v2/internallog"
34+ // GrantType for a sts exchange.
35+ GrantType = "urn:ietf:params:oauth:grant-type:token-exchange"
36+ // TokenType for a sts exchange.
37+ TokenType = "urn:ietf:params:oauth:token-type:access_token"
39+ jwtTokenType = "urn:ietf:params:oauth:token-type:jwt"
42+// Options stores the configuration for making an sts exchange request.
47+ Request *TokenRequest
48+ Authentication ClientAuthentication
50+ // ExtraOpts are optional fields marshalled into the `options` field of the
52+ ExtraOpts map[string]interface{}
56+// RefreshAccessToken performs the token exchange using a refresh token flow.
57+func RefreshAccessToken(ctx context.Context, opts *Options) (*TokenResponse, error) {
59+ data.Set("grant_type", "refresh_token")
60+ data.Set("refresh_token", opts.RefreshToken)
61+ return doRequest(ctx, opts, data)
64+// ExchangeToken performs an oauth2 token exchange with the provided endpoint.
65+func ExchangeToken(ctx context.Context, opts *Options) (*TokenResponse, error) {
67+ data.Set("audience", opts.Request.Audience)
68+ data.Set("grant_type", GrantType)
69+ data.Set("requested_token_type", TokenType)
70+ data.Set("subject_token_type", opts.Request.SubjectTokenType)
71+ data.Set("subject_token", opts.Request.SubjectToken)
72+ data.Set("scope", strings.Join(opts.Request.Scope, " "))
73+ if opts.ExtraOpts != nil {
74+ opts, err := json.Marshal(opts.ExtraOpts)
76+ return nil, fmt.Errorf("credentials: failed to marshal additional options: %w", err)
78+ data.Set("options", string(opts))
80+ return doRequest(ctx, opts, data)
83+func doRequest(ctx context.Context, opts *Options, data url.Values) (*TokenResponse, error) {
84+ opts.Authentication.InjectAuthentication(data, opts.Headers)
85+ encodedData := data.Encode()
86+ logger := internallog.New(opts.Logger)
88+ req, err := http.NewRequestWithContext(ctx, "POST", opts.Endpoint, strings.NewReader(encodedData))
90+ return nil, fmt.Errorf("credentials: failed to properly build http request: %w", err)
93+ for key, list := range opts.Headers {
94+ for _, val := range list {
95+ req.Header.Add(key, val)
98+ req.Header.Set("Content-Length", strconv.Itoa(len(encodedData)))
100+ logger.DebugContext(ctx, "sts token request", "request", internallog.HTTPRequest(req, []byte(encodedData)))
101+ resp, body, err := internal.DoRequest(opts.Client, req)
103+ return nil, fmt.Errorf("credentials: invalid response from Secure Token Server: %w", err)
105+ logger.DebugContext(ctx, "sts token response", "response", internallog.HTTPResponse(resp, body))
106+ if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices {
107+ return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
109+ var stsResp TokenResponse
110+ if err := json.Unmarshal(body, &stsResp); err != nil {
111+ return nil, fmt.Errorf("credentials: failed to unmarshal response body from Secure Token Server: %w", err)
114+ return &stsResp, nil
117+// TokenRequest contains fields necessary to make an oauth2 token
119+type TokenRequest struct {
120+ ActingParty struct {
122+ ActorTokenType string
128+ RequestedTokenType string
130+ SubjectTokenType string
133+// TokenResponse is used to decode the remote server response during
134+// an oauth2 token exchange.
135+type TokenResponse struct {
136+ AccessToken string `json:"access_token"`
137+ IssuedTokenType string `json:"issued_token_type"`
138+ TokenType string `json:"token_type"`
139+ ExpiresIn int `json:"expires_in"`
140+ Scope string `json:"scope"`
141+ RefreshToken string `json:"refresh_token"`
144+// ClientAuthentication represents an OAuth client ID and secret and the
145+// mechanism for passing these credentials as stated in rfc6749#2.3.1.
146+type ClientAuthentication struct {
147+ AuthStyle auth.Style
152+// InjectAuthentication is used to add authentication to a Secure Token Service
153+// exchange request. It modifies either the passed url.Values or http.Header
154+// depending on the desired authentication format.
155+func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) {
156+ if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil {
159+ switch c.AuthStyle {
160+ case auth.StyleInHeader:
161+ plainHeader := c.ClientID + ":" + c.ClientSecret
162+ headers.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(plainHeader)))
164+ values.Set("client_id", c.ClientID)
165+ values.Set("client_secret", c.ClientSecret)
vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.gonew file+89
@@ -0,0 +1,89 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
26+ "cloud.google.com/go/auth"
27+ "cloud.google.com/go/auth/internal"
28+ "cloud.google.com/go/auth/internal/credsfile"
29+ "cloud.google.com/go/auth/internal/jwt"
34+ now func() time.Time = time.Now
37+// configureSelfSignedJWT uses the private key in the service account to create
38+// a JWT without making a network call.
39+func configureSelfSignedJWT(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
40+ if len(opts.scopes()) == 0 && opts.Audience == "" {
41+ return nil, errors.New("credentials: both scopes and audience are empty")
43+ signer, err := internal.ParseKey([]byte(f.PrivateKey))
45+ return nil, fmt.Errorf("credentials: could not parse key: %w", err)
47+ return &selfSignedTokenProvider{
48+ email: f.ClientEmail,
49+ audience: opts.Audience,
50+ scopes: opts.scopes(),
52+ pkID: f.PrivateKeyID,
53+ logger: opts.logger(),
57+type selfSignedTokenProvider struct {
66+func (tp *selfSignedTokenProvider) Token(context.Context) (*auth.Token, error) {
68+ exp := iat.Add(time.Hour)
69+ scope := strings.Join(tp.scopes, " ")
79+ Algorithm: jwt.HeaderAlgRSA256,
80+ Type: jwt.HeaderType,
81+ KeyID: string(tp.pkID),
83+ tok, err := jwt.EncodeJWS(h, c, tp.signer)
85+ return nil, fmt.Errorf("credentials: could not encode JWT: %w", err)
87+ tp.logger.Debug("created self-signed JWT", "token", tok)
88+ return &auth.Token{Value: tok, Type: internal.TokenTypeBearer, Expiry: exp}, nil
vendor/cloud.google.com/go/auth/httptransport/httptransport.gonew file+247
@@ -0,0 +1,247 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package httptransport provides functionality for managing HTTP client
16+// connections to Google Cloud services.
26+ "cloud.google.com/go/auth"
27+ detect "cloud.google.com/go/auth/credentials"
28+ "cloud.google.com/go/auth/internal"
29+ "cloud.google.com/go/auth/internal/transport"
30+ "github.com/googleapis/gax-go/v2/internallog"
33+// ClientCertProvider is a function that returns a TLS client certificate to be
34+// used when opening TLS connections. It follows the same semantics as
35+// [crypto/tls.Config.GetClientCertificate].
36+type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
38+// Options used to configure a [net/http.Client] from [NewClient].
40+ // DisableTelemetry disables default telemetry (OpenTelemetry). An example
41+ // reason to do so would be to bind custom telemetry that overrides the
43+ DisableTelemetry bool
44+ // DisableAuthentication specifies that no authentication should be used. It
45+ // is suitable only for testing and for accessing public resources, like
46+ // public Google Cloud Storage buckets.
47+ DisableAuthentication bool
48+ // Headers are extra HTTP headers that will be appended to every outgoing
51+ // BaseRoundTripper overrides the base transport used for serving requests.
52+ // If specified ClientCertProvider is ignored.
53+ BaseRoundTripper http.RoundTripper
54+ // Endpoint overrides the default endpoint to be used for a service.
56+ // APIKey specifies an API key to be used as the basis for authentication.
57+ // If set DetectOpts are ignored.
59+ // Credentials used to add Authorization header to all requests. If set
60+ // DetectOpts are ignored.
61+ Credentials *auth.Credentials
62+ // ClientCertProvider is a function that returns a TLS client certificate to
63+ // be used when opening TLS connections. It follows the same semantics as
64+ // crypto/tls.Config.GetClientCertificate.
65+ ClientCertProvider ClientCertProvider
66+ // DetectOpts configures settings for detect Application Default
68+ DetectOpts *detect.DetectOptions
69+ // UniverseDomain is the default service domain for a given Cloud universe.
70+ // The default value is "googleapis.com". This is the universe domain
71+ // configured for the client, which will be compared to the universe domain
72+ // that is separately configured for the credentials.
73+ UniverseDomain string
74+ // Logger is used for debug logging. If provided, logging will be enabled
75+ // at the loggers configured level. By default logging is disabled unless
76+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
77+ // logger will be used. Optional.
80+ // InternalOptions are NOT meant to be set directly by consumers of this
81+ // package, they should only be set by generated client code.
82+ InternalOptions *InternalOptions
85+func (o *Options) validate() error {
87+ return errors.New("httptransport: opts required to be non-nil")
89+ if o.InternalOptions != nil && o.InternalOptions.SkipValidation {
92+ hasCreds := o.APIKey != "" ||
93+ o.Credentials != nil ||
94+ (o.DetectOpts != nil && len(o.DetectOpts.CredentialsJSON) > 0) ||
95+ (o.DetectOpts != nil && o.DetectOpts.CredentialsFile != "")
96+ if o.DisableAuthentication && hasCreds {
97+ return errors.New("httptransport: DisableAuthentication is incompatible with options that set or detect credentials")
102+// client returns the client a user set for the detect options or nil if one was
104+func (o *Options) client() *http.Client {
105+ if o.DetectOpts != nil && o.DetectOpts.Client != nil {
106+ return o.DetectOpts.Client
111+func (o *Options) logger() *slog.Logger {
112+ return internallog.New(o.Logger)
115+func (o *Options) resolveDetectOptions() *detect.DetectOptions {
116+ io := o.InternalOptions
117+ // soft-clone these so we are not updating a ref the user holds and may reuse
118+ do := transport.CloneDetectOptions(o.DetectOpts)
120+ // If scoped JWTs are enabled user provided an aud, allow self-signed JWT.
121+ if (io != nil && io.EnableJWTWithScope) || do.Audience != "" {
122+ do.UseSelfSignedJWT = true
124+ // Only default scopes if user did not also set an audience.
125+ if len(do.Scopes) == 0 && do.Audience == "" && io != nil && len(io.DefaultScopes) > 0 {
126+ do.Scopes = make([]string, len(io.DefaultScopes))
127+ copy(do.Scopes, io.DefaultScopes)
129+ if len(do.Scopes) == 0 && do.Audience == "" && io != nil {
130+ do.Audience = o.InternalOptions.DefaultAudience
132+ if o.ClientCertProvider != nil {
133+ tlsConfig := &tls.Config{
134+ GetClientCertificate: o.ClientCertProvider,
136+ do.Client = transport.DefaultHTTPClientWithTLS(tlsConfig)
137+ do.TokenURL = detect.GoogleMTLSTokenURL
139+ if do.Logger == nil {
140+ do.Logger = o.logger()
145+// InternalOptions are only meant to be set by generated client code. These are
146+// not meant to be set directly by consumers of this package. Configuration in
147+// this type is considered EXPERIMENTAL and may be removed at any time in the
148+// future without warning.
149+type InternalOptions struct {
150+ // EnableJWTWithScope specifies if scope can be used with self-signed JWT.
151+ EnableJWTWithScope bool
152+ // DefaultAudience specifies a default audience to be used as the audience
153+ // field ("aud") for the JWT token authentication.
154+ DefaultAudience string
155+ // DefaultEndpointTemplate combined with UniverseDomain specifies the
156+ // default endpoint.
157+ DefaultEndpointTemplate string
158+ // DefaultMTLSEndpoint specifies the default mTLS endpoint.
159+ DefaultMTLSEndpoint string
160+ // DefaultScopes specifies the default OAuth2 scopes to be used for a
162+ DefaultScopes []string
163+ // SkipValidation bypasses validation on Options. It should only be used
164+ // internally for clients that need more control over their transport.
166+ // SkipUniverseDomainValidation skips the verification that the universe
167+ // domain configured for the client matches the universe domain configured
168+ // for the credentials. It should only be used internally for clients that
169+ // need more control over their transport. The default is false.
170+ SkipUniverseDomainValidation bool
173+// AddAuthorizationMiddleware adds a middleware to the provided client's
174+// transport that sets the Authorization header with the value produced by the
175+// provided [cloud.google.com/go/auth.Credentials]. An error is returned only
176+// if client or creds is nil.
178+// This function does not support setting a universe domain value on the client.
179+func AddAuthorizationMiddleware(client *http.Client, creds *auth.Credentials) error {
180+ if client == nil || creds == nil {
181+ return fmt.Errorf("httptransport: client and tp must not be nil")
183+ base := client.Transport
185+ if dt, ok := http.DefaultTransport.(*http.Transport); ok {
188+ // Directly reuse the DefaultTransport if the application has
189+ // replaced it with an implementation of RoundTripper other than
191+ base = http.DefaultTransport
194+ client.Transport = &authTransport{
201+// NewClient returns a [net/http.Client] that can be used to communicate with a
202+// Google cloud service, configured with the provided [Options]. It
203+// automatically appends Authorization headers to all outgoing requests.
204+func NewClient(opts *Options) (*http.Client, error) {
205+ if err := opts.validate(); err != nil {
209+ tOpts := &transport.Options{
210+ Endpoint: opts.Endpoint,
211+ ClientCertProvider: opts.ClientCertProvider,
212+ Client: opts.client(),
213+ UniverseDomain: opts.UniverseDomain,
214+ Logger: opts.logger(),
216+ if io := opts.InternalOptions; io != nil {
217+ tOpts.DefaultEndpointTemplate = io.DefaultEndpointTemplate
218+ tOpts.DefaultMTLSEndpoint = io.DefaultMTLSEndpoint
220+ clientCertProvider, dialTLSContext, err := transport.GetHTTPTransportConfig(tOpts)
224+ baseRoundTripper := opts.BaseRoundTripper
225+ if baseRoundTripper == nil {
226+ baseRoundTripper = defaultBaseTransport(clientCertProvider, dialTLSContext)
228+ // Ensure the token exchange transport uses the same ClientCertProvider as the API transport.
229+ opts.ClientCertProvider = clientCertProvider
230+ trans, err := newTransport(baseRoundTripper, opts)
234+ return &http.Client{
239+// SetAuthHeader uses the provided token to set the Authorization header on a
240+// request. If the token.Type is empty, the type is assumed to be Bearer.
241+func SetAuthHeader(token *auth.Token, req *http.Request) {
244+ typ = internal.TokenTypeBearer
246+ req.Header.Set("Authorization", typ+" "+token.Value)
vendor/cloud.google.com/go/auth/httptransport/transport.gonew file+234
@@ -0,0 +1,234 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
25+ "cloud.google.com/go/auth"
26+ "cloud.google.com/go/auth/credentials"
27+ "cloud.google.com/go/auth/internal"
28+ "cloud.google.com/go/auth/internal/transport"
29+ "cloud.google.com/go/auth/internal/transport/cert"
30+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
31+ "golang.org/x/net/http2"
35+ quotaProjectHeaderKey = "X-goog-user-project"
38+func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, error) {
39+ var headers = opts.Headers
40+ ht := &headerTransport{
44+ var trans http.RoundTripper = ht
45+ trans = addOpenTelemetryTransport(trans, opts)
47+ case opts.DisableAuthentication:
49+ case opts.APIKey != "":
50+ qp := internal.GetQuotaProject(nil, opts.Headers.Get(quotaProjectHeaderKey))
53+ headers = make(map[string][]string, 1)
55+ headers.Set(quotaProjectHeaderKey, qp)
57+ trans = &apiKeyTransport{
62+ var creds *auth.Credentials
63+ if opts.Credentials != nil {
64+ creds = opts.Credentials
67+ creds, err = credentials.DetectDefault(opts.resolveDetectOptions())
72+ qp, err := creds.QuotaProjectID(context.Background())
78+ headers = make(map[string][]string, 1)
80+ // Don't overwrite user specified quota
81+ if v := headers.Get(quotaProjectHeaderKey); v == "" {
82+ headers.Set(quotaProjectHeaderKey, qp)
86+ if iOpts := opts.InternalOptions; iOpts != nil {
87+ skipUD = iOpts.SkipUniverseDomainValidation
89+ creds.TokenProvider = auth.NewCachedTokenProvider(creds.TokenProvider, nil)
90+ trans = &authTransport{
93+ clientUniverseDomain: opts.UniverseDomain,
94+ skipUniverseDomainValidation: skipUD,
100+// defaultBaseTransport returns the base HTTP transport.
101+// On App Engine, this is urlfetch.Transport.
102+// Otherwise, use a default transport, taking most defaults from
103+// http.DefaultTransport.
104+// If TLSCertificate is available, set TLSClientConfig as well.
105+func defaultBaseTransport(clientCertSource cert.Provider, dialTLSContext func(context.Context, string, string) (net.Conn, error)) http.RoundTripper {
106+ defaultTransport, ok := http.DefaultTransport.(*http.Transport)
108+ defaultTransport = transport.BaseTransport()
110+ trans := defaultTransport.Clone()
111+ trans.MaxIdleConnsPerHost = 100
113+ if clientCertSource != nil {
114+ trans.TLSClientConfig = &tls.Config{
115+ GetClientCertificate: clientCertSource,
118+ if dialTLSContext != nil {
119+ // If DialTLSContext is set, TLSClientConfig wil be ignored
120+ trans.DialTLSContext = dialTLSContext
123+ // Configures the ReadIdleTimeout HTTP/2 option for the
124+ // transport. This allows broken idle connections to be pruned more quickly,
125+ // preventing the client from attempting to re-use connections that will no
127+ http2Trans, err := http2.ConfigureTransports(trans)
129+ http2Trans.ReadIdleTimeout = time.Second * 31
135+type apiKeyTransport struct {
136+ // Key is the API Key to set on requests.
138+ // Transport is the underlying HTTP transport.
139+ // If nil, http.DefaultTransport is used.
140+ Transport http.RoundTripper
143+func (t *apiKeyTransport) RoundTrip(req *http.Request) (*http.Response, error) {
145+ args := newReq.URL.Query()
146+ args.Set("key", t.Key)
147+ newReq.URL.RawQuery = args.Encode()
148+ return t.Transport.RoundTrip(&newReq)
151+type headerTransport struct {
153+ base http.RoundTripper
156+func (t *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) {
159+ newReq.Header = make(http.Header)
160+ for k, vv := range req.Header {
161+ newReq.Header[k] = vv
164+ for k, v := range t.headers {
165+ newReq.Header[k] = v
168+ return rt.RoundTrip(&newReq)
171+func addOpenTelemetryTransport(trans http.RoundTripper, opts *Options) http.RoundTripper {
172+ if opts.DisableTelemetry {
175+ return otelhttp.NewTransport(trans)
178+type authTransport struct {
179+ creds *auth.Credentials
180+ base http.RoundTripper
181+ clientUniverseDomain string
182+ skipUniverseDomainValidation bool
185+// getClientUniverseDomain returns the default service domain for a given Cloud
186+// universe, with the following precedence:
188+// 1. A non-empty option.WithUniverseDomain or similar client option.
189+// 2. A non-empty environment variable GOOGLE_CLOUD_UNIVERSE_DOMAIN.
190+// 3. The default value "googleapis.com".
192+// This is the universe domain configured for the client, which will be compared
193+// to the universe domain that is separately configured for the credentials.
194+func (t *authTransport) getClientUniverseDomain() string {
195+ if t.clientUniverseDomain != "" {
196+ return t.clientUniverseDomain
198+ if envUD := os.Getenv(internal.UniverseDomainEnvVar); envUD != "" {
201+ return internal.DefaultUniverseDomain
204+// RoundTrip authorizes and authenticates the request with an
205+// access token from Transport's Source. Per the RoundTripper contract we must
206+// not modify the initial request, so we clone it, and we must close the body
207+// on any errors that happens during our token logic.
208+func (t *authTransport) RoundTrip(req *http.Request) (*http.Response, error) {
209+ reqBodyClosed := false
210+ if req.Body != nil {
217+ token, err := t.creds.Token(req.Context())
221+ if !t.skipUniverseDomainValidation && token.MetadataString("auth.google.tokenSource") != "compute-metadata" {
222+ credentialsUniverseDomain, err := t.creds.UniverseDomain(req.Context())
226+ if err := transport.ValidateUniverseDomain(t.getClientUniverseDomain(), credentialsUniverseDomain); err != nil {
230+ req2 := req.Clone(req.Context())
231+ SetAuthHeader(token, req2)
232+ reqBodyClosed = true
233+ return t.base.RoundTrip(req2)
vendor/cloud.google.com/go/auth/internal/credsfile/credsfile.gonew file+107
@@ -0,0 +1,107 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package credsfile is meant to hide implementation details from the pubic
16+// surface of the detect package. It should not import any other packages in
17+// this module. It is located under the main internal package so other
18+// sub-packages can use these parsed types as well.
29+ // GoogleAppCredsEnvVar is the environment variable for setting the
30+ // application default credentials.
31+ GoogleAppCredsEnvVar = "GOOGLE_APPLICATION_CREDENTIALS"
32+ userCredsFilename = "application_default_credentials.json"
35+// CredentialType represents different credential filetypes Google credentials
37+type CredentialType int
40+ // UnknownCredType is an unidentified file type.
41+ UnknownCredType CredentialType = iota
42+ // UserCredentialsKey represents a user creds file type.
44+ // ServiceAccountKey represents a service account file type.
46+ // ImpersonatedServiceAccountKey represents a impersonated service account
48+ ImpersonatedServiceAccountKey
49+ // ExternalAccountKey represents a external account file type.
51+ // GDCHServiceAccountKey represents a GDCH file type.
52+ GDCHServiceAccountKey
53+ // ExternalAccountAuthorizedUserKey represents a external account authorized
55+ ExternalAccountAuthorizedUserKey
58+// parseCredentialType returns the associated filetype based on the parsed
59+// typeString provided.
60+func parseCredentialType(typeString string) CredentialType {
62+ case "service_account":
63+ return ServiceAccountKey
64+ case "authorized_user":
65+ return UserCredentialsKey
66+ case "impersonated_service_account":
67+ return ImpersonatedServiceAccountKey
68+ case "external_account":
69+ return ExternalAccountKey
70+ case "external_account_authorized_user":
71+ return ExternalAccountAuthorizedUserKey
72+ case "gdch_service_account":
73+ return GDCHServiceAccountKey
75+ return UnknownCredType
79+// GetFileNameFromEnv returns the override if provided or detects a filename
80+// from the environment.
81+func GetFileNameFromEnv(override string) string {
85+ return os.Getenv(GoogleAppCredsEnvVar)
88+// GetWellKnownFileName tries to locate the filepath for the user credential
89+// file based on the environment.
90+func GetWellKnownFileName() string {
91+ if runtime.GOOS == "windows" {
92+ return filepath.Join(os.Getenv("APPDATA"), "gcloud", userCredsFilename)
94+ return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", userCredsFilename)
97+// guessUnixHomeDir default to checking for HOME, but not all unix systems have
98+// this set, do have a fallback.
99+func guessUnixHomeDir() string {
100+ if v := os.Getenv("HOME"); v != "" {
103+ if u, err := user.Current(); err == nil {
vendor/cloud.google.com/go/auth/internal/credsfile/filetype.gonew file+157
@@ -0,0 +1,157 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
21+// Config3LO is the internals of a client creds file.
22+type Config3LO struct {
23+ ClientID string `json:"client_id"`
24+ ClientSecret string `json:"client_secret"`
25+ RedirectURIs []string `json:"redirect_uris"`
26+ AuthURI string `json:"auth_uri"`
27+ TokenURI string `json:"token_uri"`
30+// ClientCredentialsFile representation.
31+type ClientCredentialsFile struct {
32+ Web *Config3LO `json:"web"`
33+ Installed *Config3LO `json:"installed"`
34+ UniverseDomain string `json:"universe_domain"`
37+// ServiceAccountFile representation.
38+type ServiceAccountFile struct {
39+ Type string `json:"type"`
40+ ProjectID string `json:"project_id"`
41+ PrivateKeyID string `json:"private_key_id"`
42+ PrivateKey string `json:"private_key"`
43+ ClientEmail string `json:"client_email"`
44+ ClientID string `json:"client_id"`
45+ AuthURL string `json:"auth_uri"`
46+ TokenURL string `json:"token_uri"`
47+ UniverseDomain string `json:"universe_domain"`
50+// UserCredentialsFile representation.
51+type UserCredentialsFile struct {
52+ Type string `json:"type"`
53+ ClientID string `json:"client_id"`
54+ ClientSecret string `json:"client_secret"`
55+ QuotaProjectID string `json:"quota_project_id"`
56+ RefreshToken string `json:"refresh_token"`
57+ UniverseDomain string `json:"universe_domain"`
60+// ExternalAccountFile representation.
61+type ExternalAccountFile struct {
62+ Type string `json:"type"`
63+ ClientID string `json:"client_id"`
64+ ClientSecret string `json:"client_secret"`
65+ Audience string `json:"audience"`
66+ SubjectTokenType string `json:"subject_token_type"`
67+ ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"`
68+ TokenURL string `json:"token_url"`
69+ CredentialSource *CredentialSource `json:"credential_source,omitempty"`
70+ TokenInfoURL string `json:"token_info_url"`
71+ ServiceAccountImpersonation *ServiceAccountImpersonationInfo `json:"service_account_impersonation,omitempty"`
72+ QuotaProjectID string `json:"quota_project_id"`
73+ WorkforcePoolUserProject string `json:"workforce_pool_user_project"`
74+ UniverseDomain string `json:"universe_domain"`
77+// ExternalAccountAuthorizedUserFile representation.
78+type ExternalAccountAuthorizedUserFile struct {
79+ Type string `json:"type"`
80+ Audience string `json:"audience"`
81+ ClientID string `json:"client_id"`
82+ ClientSecret string `json:"client_secret"`
83+ RefreshToken string `json:"refresh_token"`
84+ TokenURL string `json:"token_url"`
85+ TokenInfoURL string `json:"token_info_url"`
86+ RevokeURL string `json:"revoke_url"`
87+ QuotaProjectID string `json:"quota_project_id"`
88+ UniverseDomain string `json:"universe_domain"`
91+// CredentialSource stores the information necessary to retrieve the credentials for the STS exchange.
93+// One field amongst File, URL, Certificate, and Executable should be filled, depending on the kind of credential in question.
94+// The EnvironmentID should start with AWS if being used for an AWS credential.
95+type CredentialSource struct {
96+ File string `json:"file"`
97+ URL string `json:"url"`
98+ Headers map[string]string `json:"headers"`
99+ Executable *ExecutableConfig `json:"executable,omitempty"`
100+ Certificate *CertificateConfig `json:"certificate"`
101+ EnvironmentID string `json:"environment_id"` // TODO: Make type for this
102+ RegionURL string `json:"region_url"`
103+ RegionalCredVerificationURL string `json:"regional_cred_verification_url"`
104+ CredVerificationURL string `json:"cred_verification_url"`
105+ IMDSv2SessionTokenURL string `json:"imdsv2_session_token_url"`
106+ Format *Format `json:"format,omitempty"`
109+// Format describes the format of a [CredentialSource].
111+ // Type is either "text" or "json". When not provided "text" type is assumed.
112+ Type string `json:"type"`
113+ // SubjectTokenFieldName is only required for JSON format. This would be "access_token" for azure.
114+ SubjectTokenFieldName string `json:"subject_token_field_name"`
117+// ExecutableConfig represents the command to run for an executable
118+// [CredentialSource].
119+type ExecutableConfig struct {
120+ Command string `json:"command"`
121+ TimeoutMillis int `json:"timeout_millis"`
122+ OutputFile string `json:"output_file"`
125+// CertificateConfig represents the options used to set up X509 based workload
126+// [CredentialSource]
127+type CertificateConfig struct {
128+ UseDefaultCertificateConfig bool `json:"use_default_certificate_config"`
129+ CertificateConfigLocation string `json:"certificate_config_location"`
132+// ServiceAccountImpersonationInfo has impersonation configuration.
133+type ServiceAccountImpersonationInfo struct {
134+ TokenLifetimeSeconds int `json:"token_lifetime_seconds"`
137+// ImpersonatedServiceAccountFile representation.
138+type ImpersonatedServiceAccountFile struct {
139+ Type string `json:"type"`
140+ ServiceAccountImpersonationURL string `json:"service_account_impersonation_url"`
141+ Delegates []string `json:"delegates"`
142+ CredSource json.RawMessage `json:"source_credentials"`
143+ UniverseDomain string `json:"universe_domain"`
146+// GDCHServiceAccountFile represents the Google Distributed Cloud Hosted (GDCH) service identity file.
147+type GDCHServiceAccountFile struct {
148+ Type string `json:"type"`
149+ FormatVersion string `json:"format_version"`
150+ Project string `json:"project"`
151+ Name string `json:"name"`
152+ CertPath string `json:"ca_cert_path"`
153+ PrivateKeyID string `json:"private_key_id"`
154+ PrivateKey string `json:"private_key"`
155+ TokenURL string `json:"token_uri"`
156+ UniverseDomain string `json:"universe_domain"`
vendor/cloud.google.com/go/auth/internal/credsfile/parse.gonew file+98
@@ -0,0 +1,98 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
21+// ParseServiceAccount parses bytes into a [ServiceAccountFile].
22+func ParseServiceAccount(b []byte) (*ServiceAccountFile, error) {
23+ var f *ServiceAccountFile
24+ if err := json.Unmarshal(b, &f); err != nil {
30+// ParseClientCredentials parses bytes into a
31+// [credsfile.ClientCredentialsFile].
32+func ParseClientCredentials(b []byte) (*ClientCredentialsFile, error) {
33+ var f *ClientCredentialsFile
34+ if err := json.Unmarshal(b, &f); err != nil {
40+// ParseUserCredentials parses bytes into a [UserCredentialsFile].
41+func ParseUserCredentials(b []byte) (*UserCredentialsFile, error) {
42+ var f *UserCredentialsFile
43+ if err := json.Unmarshal(b, &f); err != nil {
49+// ParseExternalAccount parses bytes into a [ExternalAccountFile].
50+func ParseExternalAccount(b []byte) (*ExternalAccountFile, error) {
51+ var f *ExternalAccountFile
52+ if err := json.Unmarshal(b, &f); err != nil {
58+// ParseExternalAccountAuthorizedUser parses bytes into a
59+// [ExternalAccountAuthorizedUserFile].
60+func ParseExternalAccountAuthorizedUser(b []byte) (*ExternalAccountAuthorizedUserFile, error) {
61+ var f *ExternalAccountAuthorizedUserFile
62+ if err := json.Unmarshal(b, &f); err != nil {
68+// ParseImpersonatedServiceAccount parses bytes into a
69+// [ImpersonatedServiceAccountFile].
70+func ParseImpersonatedServiceAccount(b []byte) (*ImpersonatedServiceAccountFile, error) {
71+ var f *ImpersonatedServiceAccountFile
72+ if err := json.Unmarshal(b, &f); err != nil {
78+// ParseGDCHServiceAccount parses bytes into a [GDCHServiceAccountFile].
79+func ParseGDCHServiceAccount(b []byte) (*GDCHServiceAccountFile, error) {
80+ var f *GDCHServiceAccountFile
81+ if err := json.Unmarshal(b, &f); err != nil {
87+type fileTypeChecker struct {
88+ Type string `json:"type"`
91+// ParseFileType determines the [CredentialType] based on bytes provided.
92+func ParseFileType(b []byte) (CredentialType, error) {
93+ var f fileTypeChecker
94+ if err := json.Unmarshal(b, &f); err != nil {
97+ return parseCredentialType(f.Type), nil
vendor/cloud.google.com/go/auth/internal/internal.gonew file+219
@@ -0,0 +1,219 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
31+ "cloud.google.com/go/compute/metadata"
35+ // TokenTypeBearer is the auth header prefix for bearer tokens.
36+ TokenTypeBearer = "Bearer"
38+ // QuotaProjectEnvVar is the environment variable for setting the quota
40+ QuotaProjectEnvVar = "GOOGLE_CLOUD_QUOTA_PROJECT"
41+ // UniverseDomainEnvVar is the environment variable for setting the default
42+ // service domain for a given Cloud universe.
43+ UniverseDomainEnvVar = "GOOGLE_CLOUD_UNIVERSE_DOMAIN"
44+ projectEnvVar = "GOOGLE_CLOUD_PROJECT"
45+ maxBodySize = 1 << 20
47+ // DefaultUniverseDomain is the default value for universe domain.
48+ // Universe domain is the default service domain for a given Cloud universe.
49+ DefaultUniverseDomain = "googleapis.com"
52+type clonableTransport interface {
53+ Clone() *http.Transport
56+// DefaultClient returns an [http.Client] with some defaults set. If
57+// the current [http.DefaultTransport] is a [clonableTransport], as
58+// is the case for an [*http.Transport], the clone will be used.
59+// Otherwise the [http.DefaultTransport] is used directly.
60+func DefaultClient() *http.Client {
61+ if transport, ok := http.DefaultTransport.(clonableTransport); ok {
63+ Transport: transport.Clone(),
64+ Timeout: 30 * time.Second,
69+ Transport: http.DefaultTransport,
70+ Timeout: 30 * time.Second,
74+// ParseKey converts the binary contents of a private key file
75+// to an crypto.Signer. It detects whether the private key is in a
76+// PEM container or not. If so, it extracts the the private key
77+// from PEM container before conversion. It only supports PEM
78+// containers with no passphrase.
79+func ParseKey(key []byte) (crypto.Signer, error) {
80+ block, _ := pem.Decode(key)
84+ var parsedKey crypto.PrivateKey
86+ parsedKey, err = x509.ParsePKCS8PrivateKey(key)
88+ parsedKey, err = x509.ParsePKCS1PrivateKey(key)
90+ return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8: %w", err)
93+ parsed, ok := parsedKey.(crypto.Signer)
95+ return nil, errors.New("private key is not a signer")
100+// GetQuotaProject retrieves quota project with precedence being: override,
101+// environment variable, creds json file.
102+func GetQuotaProject(b []byte, override string) string {
106+ if env := os.Getenv(QuotaProjectEnvVar); env != "" {
113+ QuotaProject string `json:"quota_project_id"`
115+ if err := json.Unmarshal(b, &v); err != nil {
118+ return v.QuotaProject
121+// GetProjectID retrieves project with precedence being: override,
122+// environment variable, creds json file.
123+func GetProjectID(b []byte, override string) string {
127+ if env := os.Getenv(projectEnvVar); env != "" {
134+ ProjectID string `json:"project_id"` // standard service account key
135+ Project string `json:"project"` // gdch key
137+ if err := json.Unmarshal(b, &v); err != nil {
140+ if v.ProjectID != "" {
146+// DoRequest executes the provided req with the client. It reads the response
147+// body, closes it, and returns it.
148+func DoRequest(client *http.Client, req *http.Request) (*http.Response, []byte, error) {
149+ resp, err := client.Do(req)
151+ return nil, nil, err
153+ defer resp.Body.Close()
154+ body, err := ReadAll(io.LimitReader(resp.Body, maxBodySize))
156+ return nil, nil, err
158+ return resp, body, nil
161+// ReadAll consumes the whole reader and safely reads the content of its body
162+// with some overflow protection.
163+func ReadAll(r io.Reader) ([]byte, error) {
164+ return io.ReadAll(io.LimitReader(r, maxBodySize))
167+// StaticCredentialsProperty is a helper for creating static credentials
169+func StaticCredentialsProperty(s string) StaticProperty {
170+ return StaticProperty(s)
173+// StaticProperty always returns that value of the underlying string.
174+type StaticProperty string
176+// GetProperty loads the properly value provided the given context.
177+func (p StaticProperty) GetProperty(context.Context) (string, error) {
178+ return string(p), nil
181+// ComputeUniverseDomainProvider fetches the credentials universe domain from
182+// the google cloud metadata service.
183+type ComputeUniverseDomainProvider struct {
184+ MetadataClient *metadata.Client
185+ universeDomainOnce sync.Once
186+ universeDomain string
187+ universeDomainErr error
190+// GetProperty fetches the credentials universe domain from the google cloud
192+func (c *ComputeUniverseDomainProvider) GetProperty(ctx context.Context) (string, error) {
193+ c.universeDomainOnce.Do(func() {
194+ c.universeDomain, c.universeDomainErr = getMetadataUniverseDomain(ctx, c.MetadataClient)
196+ if c.universeDomainErr != nil {
197+ return "", c.universeDomainErr
199+ return c.universeDomain, nil
202+// httpGetMetadataUniverseDomain is a package var for unit test substitution.
203+var httpGetMetadataUniverseDomain = func(ctx context.Context, client *metadata.Client) (string, error) {
204+ ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
206+ return client.GetWithContext(ctx, "universe/universe-domain")
209+func getMetadataUniverseDomain(ctx context.Context, client *metadata.Client) (string, error) {
210+ universeDomain, err := httpGetMetadataUniverseDomain(ctx, client)
212+ return universeDomain, nil
214+ if _, ok := err.(metadata.NotDefinedError); ok {
215+ // http.StatusNotFound (404)
216+ return DefaultUniverseDomain, nil
vendor/cloud.google.com/go/auth/internal/jwt/jwt.gonew file+171
@@ -0,0 +1,171 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
32+ // HeaderAlgRSA256 is the RS256 [Header.Algorithm].
33+ HeaderAlgRSA256 = "RS256"
34+ // HeaderAlgES256 is the ES256 [Header.Algorithm].
35+ HeaderAlgES256 = "ES256"
36+ // HeaderType is the standard [Header.Type].
40+// Header represents a JWT header.
42+ Algorithm string `json:"alg"`
43+ Type string `json:"typ"`
44+ KeyID string `json:"kid"`
47+func (h *Header) encode() (string, error) {
48+ b, err := json.Marshal(h)
52+ return base64.RawURLEncoding.EncodeToString(b), nil
55+// Claims represents the claims set of a JWT.
57+ // Iss is the issuer JWT claim.
58+ Iss string `json:"iss"`
59+ // Scope is the scope JWT claim.
60+ Scope string `json:"scope,omitempty"`
61+ // Exp is the expiry JWT claim. If unset, default is in one hour from now.
62+ Exp int64 `json:"exp"`
63+ // Iat is the subject issued at claim. If unset, default is now.
64+ Iat int64 `json:"iat"`
65+ // Aud is the audience JWT claim. Optional.
66+ Aud string `json:"aud"`
67+ // Sub is the subject JWT claim. Optional.
68+ Sub string `json:"sub,omitempty"`
69+ // AdditionalClaims contains any additional non-standard JWT claims. Optional.
70+ AdditionalClaims map[string]interface{} `json:"-"`
73+func (c *Claims) encode() (string, error) {
74+ // Compensate for skew
75+ now := time.Now().Add(-10 * time.Second)
80+ c.Exp = now.Add(time.Hour).Unix()
83+ return "", fmt.Errorf("jwt: invalid Exp = %d; must be later than Iat = %d", c.Exp, c.Iat)
86+ b, err := json.Marshal(c)
91+ if len(c.AdditionalClaims) == 0 {
92+ return base64.RawURLEncoding.EncodeToString(b), nil
95+ // Marshal private claim set and then append it to b.
96+ prv, err := json.Marshal(c.AdditionalClaims)
98+ return "", fmt.Errorf("invalid map of additional claims %v: %w", c.AdditionalClaims, err)
101+ // Concatenate public and private claim JSON objects.
102+ if !bytes.HasSuffix(b, []byte{'}'}) {
103+ return "", fmt.Errorf("invalid JSON %s", b)
105+ if !bytes.HasPrefix(prv, []byte{'{'}) {
106+ return "", fmt.Errorf("invalid JSON %s", prv)
108+ b[len(b)-1] = ',' // Replace closing curly brace with a comma.
109+ b = append(b, prv[1:]...) // Append private claims.
110+ return base64.RawURLEncoding.EncodeToString(b), nil
113+// EncodeJWS encodes the data using the provided key as a JSON web signature.
114+func EncodeJWS(header *Header, c *Claims, signer crypto.Signer) (string, error) {
115+ head, err := header.encode()
119+ claims, err := c.encode()
123+ ss := fmt.Sprintf("%s.%s", head, claims)
126+ sig, err := signer.Sign(rand.Reader, h.Sum(nil), crypto.SHA256)
130+ return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil
133+// DecodeJWS decodes a claim set from a JWS payload.
134+func DecodeJWS(payload string) (*Claims, error) {
135+ // decode returned id token to get expiry
136+ s := strings.Split(payload, ".")
138+ return nil, errors.New("invalid token received")
140+ decoded, err := base64.RawURLEncoding.DecodeString(s[1])
145+ if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c); err != nil {
148+ if err := json.NewDecoder(bytes.NewBuffer(decoded)).Decode(&c.AdditionalClaims); err != nil {
154+// VerifyJWS tests whether the provided JWT token's signature was produced by
155+// the private key associated with the provided public key.
156+func VerifyJWS(token string, key *rsa.PublicKey) error {
157+ parts := strings.Split(token, ".")
158+ if len(parts) != 3 {
159+ return errors.New("jwt: invalid token received, token must have 3 parts")
162+ signedContent := parts[0] + "." + parts[1]
163+ signatureString, err := base64.RawURLEncoding.DecodeString(parts[2])
169+ h.Write([]byte(signedContent))
170+ return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), signatureString)
vendor/cloud.google.com/go/auth/internal/transport/cba.gonew file+368
@@ -0,0 +1,368 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
31+ "cloud.google.com/go/auth/internal"
32+ "cloud.google.com/go/auth/internal/transport/cert"
33+ "github.com/google/s2a-go"
34+ "github.com/google/s2a-go/fallback"
35+ "google.golang.org/grpc/credentials"
39+ mTLSModeAlways = "always"
40+ mTLSModeNever = "never"
41+ mTLSModeAuto = "auto"
43+ // Experimental: if true, the code will try MTLS with S2A as the default for transport security. Default value is false.
44+ googleAPIUseS2AEnv = "EXPERIMENTAL_GOOGLE_API_USE_S2A"
45+ googleAPIUseCertSource = "GOOGLE_API_USE_CLIENT_CERTIFICATE"
46+ googleAPIUseMTLS = "GOOGLE_API_USE_MTLS_ENDPOINT"
47+ googleAPIUseMTLSOld = "GOOGLE_API_USE_MTLS"
49+ universeDomainPlaceholder = "UNIVERSE_DOMAIN"
51+ mtlsMDSRoot = "/run/google-mds-mtls/root.crt"
52+ mtlsMDSKey = "/run/google-mds-mtls/client.key"
55+// Options is a struct that is duplicated information from the individual
56+// transport packages in order to avoid cyclic deps. It correlates 1:1 with
57+// fields on httptransport.Options and grpctransport.Options.
60+ DefaultEndpointTemplate string
61+ DefaultMTLSEndpoint string
62+ ClientCertProvider cert.Provider
64+ UniverseDomain string
65+ EnableDirectPath bool
66+ EnableDirectPathXds bool
70+// getUniverseDomain returns the default service domain for a given Cloud
72+func (o *Options) getUniverseDomain() string {
73+ if o.UniverseDomain == "" {
74+ return internal.DefaultUniverseDomain
76+ return o.UniverseDomain
79+// isUniverseDomainGDU returns true if the universe domain is the default Google
81+func (o *Options) isUniverseDomainGDU() bool {
82+ return o.getUniverseDomain() == internal.DefaultUniverseDomain
85+// defaultEndpoint returns the DefaultEndpointTemplate merged with the
86+// universe domain if the DefaultEndpointTemplate is set, otherwise returns an
88+func (o *Options) defaultEndpoint() string {
89+ if o.DefaultEndpointTemplate == "" {
92+ return strings.Replace(o.DefaultEndpointTemplate, universeDomainPlaceholder, o.getUniverseDomain(), 1)
95+// defaultMTLSEndpoint returns the DefaultMTLSEndpointTemplate merged with the
96+// universe domain if the DefaultMTLSEndpointTemplate is set, otherwise returns an
98+func (o *Options) defaultMTLSEndpoint() string {
99+ if o.DefaultMTLSEndpoint == "" {
102+ return strings.Replace(o.DefaultMTLSEndpoint, universeDomainPlaceholder, o.getUniverseDomain(), 1)
105+// mergedEndpoint merges a user-provided Endpoint of format host[:port] with the
107+func (o *Options) mergedEndpoint() (string, error) {
108+ defaultEndpoint := o.defaultEndpoint()
109+ u, err := url.Parse(fixScheme(defaultEndpoint))
113+ return strings.Replace(defaultEndpoint, u.Host, o.Endpoint, 1), nil
116+func fixScheme(baseURL string) string {
117+ if !strings.Contains(baseURL, "://") {
118+ baseURL = "https://" + baseURL
123+// GetGRPCTransportCredsAndEndpoint returns an instance of
124+// [google.golang.org/grpc/credentials.TransportCredentials], and the
125+// corresponding endpoint to use for GRPC client.
126+func GetGRPCTransportCredsAndEndpoint(opts *Options) (credentials.TransportCredentials, string, error) {
127+ config, err := getTransportConfig(opts)
132+ defaultTransportCreds := credentials.NewTLS(&tls.Config{
133+ GetClientCertificate: config.clientCertSource,
137+ var transportCredsForS2A credentials.TransportCredentials
139+ if config.mtlsS2AAddress != "" {
140+ s2aAddr = config.mtlsS2AAddress
141+ transportCredsForS2A, err = loadMTLSMDSTransportCreds(mtlsMDSRoot, mtlsMDSKey)
143+ log.Printf("Loading MTLS MDS credentials failed: %v", err)
144+ if config.s2aAddress != "" {
145+ s2aAddr = config.s2aAddress
147+ return defaultTransportCreds, config.endpoint, nil
150+ } else if config.s2aAddress != "" {
151+ s2aAddr = config.s2aAddress
153+ return defaultTransportCreds, config.endpoint, nil
156+ var fallbackOpts *s2a.FallbackOptions
157+ // In case of S2A failure, fall back to the endpoint that would've been used without S2A.
158+ if fallbackHandshake, err := fallback.DefaultFallbackClientHandshakeFunc(config.endpoint); err == nil {
159+ fallbackOpts = &s2a.FallbackOptions{
160+ FallbackClientHandshakeFunc: fallbackHandshake,
164+ s2aTransportCreds, err := s2a.NewClientCreds(&s2a.ClientOptions{
165+ S2AAddress: s2aAddr,
166+ TransportCreds: transportCredsForS2A,
167+ FallbackOpts: fallbackOpts,
170+ // Use default if we cannot initialize S2A client transport credentials.
171+ return defaultTransportCreds, config.endpoint, nil
173+ return s2aTransportCreds, config.s2aMTLSEndpoint, nil
176+// GetHTTPTransportConfig returns a client certificate source and a function for
177+// dialing MTLS with S2A.
178+func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context, string, string) (net.Conn, error), error) {
179+ config, err := getTransportConfig(opts)
181+ return nil, nil, err
185+ var transportCredsForS2A credentials.TransportCredentials
187+ if config.mtlsS2AAddress != "" {
188+ s2aAddr = config.mtlsS2AAddress
189+ transportCredsForS2A, err = loadMTLSMDSTransportCreds(mtlsMDSRoot, mtlsMDSKey)
191+ log.Printf("Loading MTLS MDS credentials failed: %v", err)
192+ if config.s2aAddress != "" {
193+ s2aAddr = config.s2aAddress
195+ return config.clientCertSource, nil, nil
198+ } else if config.s2aAddress != "" {
199+ s2aAddr = config.s2aAddress
201+ return config.clientCertSource, nil, nil
204+ var fallbackOpts *s2a.FallbackOptions
205+ // In case of S2A failure, fall back to the endpoint that would've been used without S2A.
206+ if fallbackURL, err := url.Parse(config.endpoint); err == nil {
207+ if fallbackDialer, fallbackServerAddr, err := fallback.DefaultFallbackDialerAndAddress(fallbackURL.Hostname()); err == nil {
208+ fallbackOpts = &s2a.FallbackOptions{
209+ FallbackDialer: &s2a.FallbackDialer{
210+ Dialer: fallbackDialer,
211+ ServerAddr: fallbackServerAddr,
217+ dialTLSContextFunc := s2a.NewS2ADialTLSContextFunc(&s2a.ClientOptions{
218+ S2AAddress: s2aAddr,
219+ TransportCreds: transportCredsForS2A,
220+ FallbackOpts: fallbackOpts,
222+ return nil, dialTLSContextFunc, nil
225+func loadMTLSMDSTransportCreds(mtlsMDSRootFile, mtlsMDSKeyFile string) (credentials.TransportCredentials, error) {
226+ rootPEM, err := os.ReadFile(mtlsMDSRootFile)
230+ caCertPool := x509.NewCertPool()
231+ ok := caCertPool.AppendCertsFromPEM(rootPEM)
233+ return nil, errors.New("failed to load MTLS MDS root certificate")
235+ // The mTLS MDS credentials are formatted as the concatenation of a PEM-encoded certificate chain
236+ // followed by a PEM-encoded private key. For this reason, the concatenation is passed in to the
237+ // tls.X509KeyPair function as both the certificate chain and private key arguments.
238+ cert, err := tls.LoadX509KeyPair(mtlsMDSKeyFile, mtlsMDSKeyFile)
242+ tlsConfig := tls.Config{
243+ RootCAs: caCertPool,
244+ Certificates: []tls.Certificate{cert},
245+ MinVersion: tls.VersionTLS13,
247+ return credentials.NewTLS(&tlsConfig), nil
250+func getTransportConfig(opts *Options) (*transportConfig, error) {
251+ clientCertSource, err := GetClientCertificateProvider(opts)
255+ endpoint, err := getEndpoint(opts, clientCertSource)
259+ defaultTransportConfig := transportConfig{
260+ clientCertSource: clientCertSource,
264+ if !shouldUseS2A(clientCertSource, opts) {
265+ return &defaultTransportConfig, nil
268+ s2aAddress := GetS2AAddress(opts.Logger)
269+ mtlsS2AAddress := GetMTLSS2AAddress(opts.Logger)
270+ if s2aAddress == "" && mtlsS2AAddress == "" {
271+ return &defaultTransportConfig, nil
273+ return &transportConfig{
274+ clientCertSource: clientCertSource,
276+ s2aAddress: s2aAddress,
277+ mtlsS2AAddress: mtlsS2AAddress,
278+ s2aMTLSEndpoint: opts.defaultMTLSEndpoint(),
282+// GetClientCertificateProvider returns a default client certificate source, if
283+// not provided by the user.
285+// A nil default source can be returned if the source does not exist. Any exceptions
286+// encountered while initializing the default source will be reported as client
287+// error (ex. corrupt metadata file).
288+func GetClientCertificateProvider(opts *Options) (cert.Provider, error) {
289+ if !isClientCertificateEnabled(opts) {
291+ } else if opts.ClientCertProvider != nil {
292+ return opts.ClientCertProvider, nil
294+ return cert.DefaultProvider()
298+// isClientCertificateEnabled returns true by default for all GDU universe domain, unless explicitly overridden by env var
299+func isClientCertificateEnabled(opts *Options) bool {
300+ if value, ok := os.LookupEnv(googleAPIUseCertSource); ok {
301+ // error as false is OK
302+ b, _ := strconv.ParseBool(value)
305+ return opts.isUniverseDomainGDU()
308+type transportConfig struct {
309+ // The client certificate source.
310+ clientCertSource cert.Provider
311+ // The corresponding endpoint to use based on client certificate source.
313+ // The plaintext S2A address if it can be used, otherwise an empty string.
315+ // The MTLS S2A address if it can be used, otherwise an empty string.
316+ mtlsS2AAddress string
317+ // The MTLS endpoint to use with S2A.
318+ s2aMTLSEndpoint string
321+// getEndpoint returns the endpoint for the service, taking into account the
322+// user-provided endpoint override "settings.Endpoint".
324+// If no endpoint override is specified, we will either return the default
325+// endpoint or the default mTLS endpoint if a client certificate is available.
327+// You can override the default endpoint choice (mTLS vs. regular) by setting
328+// the GOOGLE_API_USE_MTLS_ENDPOINT environment variable.
330+// If the endpoint override is an address (host:port) rather than full base
331+// URL (ex. https://...), then the user-provided address will be merged into
332+// the default endpoint. For example, WithEndpoint("myhost:8000") and
333+// DefaultEndpointTemplate("https://UNIVERSE_DOMAIN/bar/baz") will return
334+// "https://myhost:8080/bar/baz". Note that this does not apply to the mTLS
336+func getEndpoint(opts *Options, clientCertSource cert.Provider) (string, error) {
337+ if opts.Endpoint == "" {
338+ mtlsMode := getMTLSMode()
339+ if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) {
340+ return opts.defaultMTLSEndpoint(), nil
342+ return opts.defaultEndpoint(), nil
344+ if strings.Contains(opts.Endpoint, "://") {
345+ // User passed in a full URL path, use it verbatim.
346+ return opts.Endpoint, nil
348+ if opts.defaultEndpoint() == "" {
349+ // If DefaultEndpointTemplate is not configured,
350+ // use the user provided endpoint verbatim. This allows a naked
351+ // "host[:port]" URL to be used with GRPC Direct Path.
352+ return opts.Endpoint, nil
355+ // Assume user-provided endpoint is host[:port], merge it with the default endpoint.
356+ return opts.mergedEndpoint()
359+func getMTLSMode() string {
360+ mode := os.Getenv(googleAPIUseMTLS)
362+ mode = os.Getenv(googleAPIUseMTLSOld) // Deprecated.
367+ return strings.ToLower(mode)
vendor/cloud.google.com/go/auth/internal/transport/cert/default_cert.gonew file+65
@@ -0,0 +1,65 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
23+// defaultCertData holds all the variables pertaining to
24+// the default certificate provider created by [DefaultProvider].
26+// A singleton model is used to allow the provider to be reused
27+// by the transport layer. As mentioned in [DefaultProvider] (provider nil, nil)
28+// may be returned to indicate a default provider could not be found, which
29+// will skip extra tls config in the transport layer .
30+type defaultCertData struct {
37+ defaultCert defaultCertData
40+// Provider is a function that can be passed into crypto/tls.Config.GetClientCertificate.
41+type Provider func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
43+// errSourceUnavailable is a sentinel error to indicate certificate source is unavailable.
44+var errSourceUnavailable = errors.New("certificate source is unavailable")
46+// DefaultProvider returns a certificate source using the preferred EnterpriseCertificateProxySource.
47+// If EnterpriseCertificateProxySource is not available, fall back to the legacy SecureConnectSource.
49+// If neither source is available (due to missing configurations), a nil Source and a nil Error are
50+// returned to indicate that a default certificate source is unavailable.
51+func DefaultProvider() (Provider, error) {
52+ defaultCert.once.Do(func() {
53+ defaultCert.provider, defaultCert.err = NewWorkloadX509CertProvider("")
54+ if errors.Is(defaultCert.err, errSourceUnavailable) {
55+ defaultCert.provider, defaultCert.err = NewEnterpriseCertificateProxyProvider("")
56+ if errors.Is(defaultCert.err, errSourceUnavailable) {
57+ defaultCert.provider, defaultCert.err = NewSecureConnectProvider("")
58+ if errors.Is(defaultCert.err, errSourceUnavailable) {
59+ defaultCert.provider, defaultCert.err = nil, nil
64+ return defaultCert.provider, defaultCert.err
vendor/cloud.google.com/go/auth/internal/transport/cert/enterprise_cert.gonew file+54
@@ -0,0 +1,54 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
20+ "github.com/googleapis/enterprise-certificate-proxy/client"
23+type ecpSource struct {
27+// NewEnterpriseCertificateProxyProvider creates a certificate source
28+// using the Enterprise Certificate Proxy client, which delegates
29+// certifcate related operations to an OS-specific "signer binary"
30+// that communicates with the native keystore (ex. keychain on MacOS).
32+// The configFilePath points to a config file containing relevant parameters
33+// such as the certificate issuer and the location of the signer binary.
34+// If configFilePath is empty, the client will attempt to load the config from
35+// a well-known gcloud location.
36+func NewEnterpriseCertificateProxyProvider(configFilePath string) (Provider, error) {
37+ key, err := client.Cred(configFilePath)
39+ // TODO(codyoss): once this is fixed upstream can handle this error a
40+ // little better here. But be safe for now and assume unavailable.
41+ return nil, errSourceUnavailable
46+ }).getClientCertificate, nil
49+func (s *ecpSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
50+ var cert tls.Certificate
51+ cert.PrivateKey = s.key
52+ cert.Certificate = s.key.CertificateChain()
vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.gonew file+124
@@ -0,0 +1,124 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
32+ metadataPath = ".secureConnect"
33+ metadataFile = "context_aware_metadata.json"
36+type secureConnectSource struct {
37+ metadata secureConnectMetadata
39+ // Cache the cert to avoid executing helper command repeatedly.
40+ cachedCertMutex sync.Mutex
41+ cachedCert *tls.Certificate
44+type secureConnectMetadata struct {
45+ Cmd []string `json:"cert_provider_command"`
48+// NewSecureConnectProvider creates a certificate source using
49+// the Secure Connect Helper and its associated metadata file.
51+// The configFilePath points to the location of the context aware metadata file.
52+// If configFilePath is empty, use the default context aware metadata location.
53+func NewSecureConnectProvider(configFilePath string) (Provider, error) {
54+ if configFilePath == "" {
55+ user, err := user.Current()
57+ // Error locating the default config means Secure Connect is not supported.
58+ return nil, errSourceUnavailable
60+ configFilePath = filepath.Join(user.HomeDir, metadataPath, metadataFile)
63+ file, err := os.ReadFile(configFilePath)
65+ // Config file missing means Secure Connect is not supported.
66+ // There are non-os.ErrNotExist errors that may be returned.
67+ // (e.g. if the home directory is /dev/null, *nix systems will
68+ // return ENOTDIR instead of ENOENT)
69+ return nil, errSourceUnavailable
72+ var metadata secureConnectMetadata
73+ if err := json.Unmarshal(file, &metadata); err != nil {
74+ return nil, fmt.Errorf("cert: could not parse JSON in %q: %w", configFilePath, err)
76+ if err := validateMetadata(metadata); err != nil {
77+ return nil, fmt.Errorf("cert: invalid config in %q: %w", configFilePath, err)
79+ return (&secureConnectSource{
81+ }).getClientCertificate, nil
84+func validateMetadata(metadata secureConnectMetadata) error {
85+ if len(metadata.Cmd) == 0 {
86+ return errors.New("empty cert_provider_command")
91+func (s *secureConnectSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
92+ s.cachedCertMutex.Lock()
93+ defer s.cachedCertMutex.Unlock()
94+ if s.cachedCert != nil && !isCertificateExpired(s.cachedCert) {
95+ return s.cachedCert, nil
97+ // Expand OS environment variables in the cert provider command such as "$HOME".
98+ for i := 0; i < len(s.metadata.Cmd); i++ {
99+ s.metadata.Cmd[i] = os.ExpandEnv(s.metadata.Cmd[i])
101+ command := s.metadata.Cmd
102+ data, err := exec.Command(command[0], command[1:]...).Output()
106+ cert, err := tls.X509KeyPair(data, data)
110+ s.cachedCert = &cert
114+// isCertificateExpired returns true if the given cert is expired or invalid.
115+func isCertificateExpired(cert *tls.Certificate) bool {
116+ if len(cert.Certificate) == 0 {
119+ parsed, err := x509.ParseCertificate(cert.Certificate[0])
123+ return time.Now().After(parsed.NotAfter)
vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.gonew file+114
@@ -0,0 +1,114 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
24+ "github.com/googleapis/enterprise-certificate-proxy/client/util"
27+type certConfigs struct {
28+ Workload *workloadSource `json:"workload"`
31+type workloadSource struct {
32+ CertPath string `json:"cert_path"`
33+ KeyPath string `json:"key_path"`
36+type certificateConfig struct {
37+ CertConfigs certConfigs `json:"cert_configs"`
40+// NewWorkloadX509CertProvider creates a certificate source
41+// that reads a certificate and private key file from the local file system.
42+// This is intended to be used for workload identity federation.
44+// The configFilePath points to a config file containing relevant parameters
45+// such as the certificate and key file paths.
46+// If configFilePath is empty, the client will attempt to load the config from
47+// a well-known gcloud location.
48+func NewWorkloadX509CertProvider(configFilePath string) (Provider, error) {
49+ if configFilePath == "" {
50+ envFilePath := util.GetConfigFilePathFromEnv()
51+ if envFilePath != "" {
52+ configFilePath = envFilePath
54+ configFilePath = util.GetDefaultConfigFilePath()
58+ certFile, keyFile, err := getCertAndKeyFiles(configFilePath)
63+ source := &workloadSource{
67+ return source.getClientCertificate, nil
70+// getClientCertificate attempts to load the certificate and key from the files specified in the
71+// certificate config.
72+func (s *workloadSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
73+ cert, err := tls.LoadX509KeyPair(s.CertPath, s.KeyPath)
80+// getCertAndKeyFiles attempts to read the provided config file and return the certificate and private
82+func getCertAndKeyFiles(configFilePath string) (string, string, error) {
83+ jsonFile, err := os.Open(configFilePath)
85+ return "", "", errSourceUnavailable
88+ byteValue, err := io.ReadAll(jsonFile)
93+ var config certificateConfig
94+ if err := json.Unmarshal(byteValue, &config); err != nil {
98+ if config.CertConfigs.Workload == nil {
99+ return "", "", errSourceUnavailable
102+ certFile := config.CertConfigs.Workload.CertPath
103+ keyFile := config.CertConfigs.Workload.KeyPath
106+ return "", "", errors.New("certificate configuration is missing the certificate file location")
110+ return "", "", errors.New("certificate configuration is missing the key file location")
113+ return certFile, keyFile, nil
vendor/cloud.google.com/go/auth/internal/transport/s2a.gonew file+138
@@ -0,0 +1,138 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
27+ "cloud.google.com/go/auth/internal/transport/cert"
28+ "cloud.google.com/go/compute/metadata"
32+ configEndpointSuffix = "instance/platform-security/auto-mtls-configuration"
36+ mtlsConfiguration *mtlsConfig
41+// GetS2AAddress returns the S2A address to be reached via plaintext connection.
42+// Returns empty string if not set or invalid.
43+func GetS2AAddress(logger *slog.Logger) string {
44+ getMetadataMTLSAutoConfig(logger)
45+ if !mtlsConfiguration.valid() {
48+ return mtlsConfiguration.S2A.PlaintextAddress
51+// GetMTLSS2AAddress returns the S2A address to be reached via MTLS connection.
52+// Returns empty string if not set or invalid.
53+func GetMTLSS2AAddress(logger *slog.Logger) string {
54+ getMetadataMTLSAutoConfig(logger)
55+ if !mtlsConfiguration.valid() {
58+ return mtlsConfiguration.S2A.MTLSAddress
61+// mtlsConfig contains the configuration for establishing MTLS connections with Google APIs.
62+type mtlsConfig struct {
63+ S2A *s2aAddresses `json:"s2a"`
66+func (c *mtlsConfig) valid() bool {
67+ return c != nil && c.S2A != nil
70+// s2aAddresses contains the plaintext and/or MTLS S2A addresses.
71+type s2aAddresses struct {
72+ // PlaintextAddress is the plaintext address to reach S2A
73+ PlaintextAddress string `json:"plaintext_address"`
74+ // MTLSAddress is the MTLS address to reach S2A
75+ MTLSAddress string `json:"mtls_address"`
78+func getMetadataMTLSAutoConfig(logger *slog.Logger) {
81+ mtlsConfiguration, err = queryConfig(logger)
83+ log.Printf("Getting MTLS config failed: %v", err)
88+var httpGetMetadataMTLSConfig = func(logger *slog.Logger) (string, error) {
89+ metadataClient := metadata.NewWithOptions(&metadata.Options{
92+ return metadataClient.GetWithContext(context.Background(), configEndpointSuffix)
95+func queryConfig(logger *slog.Logger) (*mtlsConfig, error) {
96+ resp, err := httpGetMetadataMTLSConfig(logger)
98+ return nil, fmt.Errorf("querying MTLS config from MDS endpoint failed: %w", err)
100+ var config mtlsConfig
101+ err = json.Unmarshal([]byte(resp), &config)
103+ return nil, fmt.Errorf("unmarshalling MTLS config from MDS endpoint failed: %w", err)
105+ if config.S2A == nil {
106+ return nil, fmt.Errorf("returned MTLS config from MDS endpoint is invalid: %v", config)
111+func shouldUseS2A(clientCertSource cert.Provider, opts *Options) bool {
112+ // If client cert is found, use that over S2A.
113+ if clientCertSource != nil {
116+ // If EXPERIMENTAL_GOOGLE_API_USE_S2A is not set to true, skip S2A.
117+ if !isGoogleS2AEnabled() {
120+ // If DefaultMTLSEndpoint is not set or has endpoint override, skip S2A.
121+ if opts.DefaultMTLSEndpoint == "" || opts.Endpoint != "" {
124+ // If custom HTTP client is provided, skip S2A.
125+ if opts.Client != nil {
128+ // If directPath is enabled, skip S2A.
129+ return !opts.EnableDirectPath && !opts.EnableDirectPathXds
132+func isGoogleS2AEnabled() bool {
133+ b, err := strconv.ParseBool(os.Getenv(googleAPIUseS2AEnv))
vendor/cloud.google.com/go/auth/internal/transport/transport.gonew file+106
@@ -0,0 +1,106 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package transport provided internal helpers for the two transport packages
16+// (grpctransport and httptransport).
26+ "cloud.google.com/go/auth/credentials"
29+// CloneDetectOptions clones a user set detect option into some new memory that
30+// we can internally manipulate before sending onto the detect package.
31+func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOptions {
33+ // it is valid for users not to set this, but we will need to to default
34+ // some options for them in this case so return some initialized memory
36+ return &credentials.DetectOptions{}
38+ newDo := &credentials.DetectOptions{
40+ Audience: oldDo.Audience,
41+ Subject: oldDo.Subject,
42+ EarlyTokenRefresh: oldDo.EarlyTokenRefresh,
43+ TokenURL: oldDo.TokenURL,
44+ STSAudience: oldDo.STSAudience,
45+ CredentialsFile: oldDo.CredentialsFile,
46+ UseSelfSignedJWT: oldDo.UseSelfSignedJWT,
47+ UniverseDomain: oldDo.UniverseDomain,
49+ // These fields are are pointer types that we just want to use exactly
50+ // as the user set, copy the ref
51+ Client: oldDo.Client,
52+ Logger: oldDo.Logger,
53+ AuthHandlerOptions: oldDo.AuthHandlerOptions,
56+ // Smartly size this memory and copy below.
57+ if len(oldDo.CredentialsJSON) > 0 {
58+ newDo.CredentialsJSON = make([]byte, len(oldDo.CredentialsJSON))
59+ copy(newDo.CredentialsJSON, oldDo.CredentialsJSON)
61+ if len(oldDo.Scopes) > 0 {
62+ newDo.Scopes = make([]string, len(oldDo.Scopes))
63+ copy(newDo.Scopes, oldDo.Scopes)
69+// ValidateUniverseDomain verifies that the universe domain configured for the
70+// client matches the universe domain configured for the credentials.
71+func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain string) error {
72+ if clientUniverseDomain != credentialsUniverseDomain {
74+ "the configured universe domain (%q) does not match the universe "+
75+ "domain found in the credentials (%q). If you haven't configured "+
76+ "the universe domain explicitly, \"googleapis.com\" is the default",
77+ clientUniverseDomain,
78+ credentialsUniverseDomain)
83+// DefaultHTTPClientWithTLS constructs an HTTPClient using the provided tlsConfig, to support mTLS.
84+func DefaultHTTPClientWithTLS(tlsConfig *tls.Config) *http.Client {
85+ trans := BaseTransport()
86+ trans.TLSClientConfig = tlsConfig
87+ return &http.Client{Transport: trans}
90+// BaseTransport returns a default [http.Transport] which can be used if
91+// [http.DefaultTransport] has been overwritten.
92+func BaseTransport() *http.Transport {
93+ return &http.Transport{
94+ Proxy: http.ProxyFromEnvironment,
95+ DialContext: (&net.Dialer{
96+ Timeout: 30 * time.Second,
97+ KeepAlive: 30 * time.Second,
101+ MaxIdleConnsPerHost: 100,
102+ IdleConnTimeout: 90 * time.Second,
103+ TLSHandshakeTimeout: 10 * time.Second,
104+ ExpectContinueTimeout: 1 * time.Second,
vendor/cloud.google.com/go/auth/threelegged.gonew file+382
@@ -0,0 +1,382 @@
1+// Copyright 2023 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
31+ "cloud.google.com/go/auth/internal"
32+ "github.com/googleapis/gax-go/v2/internallog"
35+// AuthorizationHandler is a 3-legged-OAuth helper that prompts the user for
36+// OAuth consent at the specified auth code URL and returns an auth code and
37+// state upon approval.
38+type AuthorizationHandler func(authCodeURL string) (code string, state string, err error)
40+// Options3LO are the options for doing a 3-legged OAuth2 flow.
41+type Options3LO struct {
42+ // ClientID is the application's ID.
44+ // ClientSecret is the application's secret. Not required if AuthHandlerOpts
47+ // AuthURL is the URL for authenticating.
49+ // TokenURL is the URL for retrieving a token.
51+ // AuthStyle is used to describe how to client info in the token request.
53+ // RefreshToken is the token used to refresh the credential. Not required
54+ // if AuthHandlerOpts is set.
56+ // RedirectURL is the URL to redirect users to. Optional.
58+ // Scopes specifies requested permissions for the Token. Optional.
61+ // URLParams are the set of values to apply to the token exchange. Optional.
63+ // Client is the client to be used to make the underlying token requests.
66+ // EarlyTokenExpiry is the time before the token expires that it should be
67+ // refreshed. If not set the default value is 3 minutes and 45 seconds.
69+ EarlyTokenExpiry time.Duration
71+ // AuthHandlerOpts provides a set of options for doing a
72+ // 3-legged OAuth2 flow with a custom [AuthorizationHandler]. Optional.
73+ AuthHandlerOpts *AuthorizationHandlerOptions
74+ // Logger is used for debug logging. If provided, logging will be enabled
75+ // at the loggers configured level. By default logging is disabled unless
76+ // enabled by setting GOOGLE_SDK_GO_LOGGING_LEVEL in which case a default
77+ // logger will be used. Optional.
81+func (o *Options3LO) validate() error {
83+ return errors.New("auth: options must be provided")
85+ if o.ClientID == "" {
86+ return errors.New("auth: client ID must be provided")
88+ if o.AuthHandlerOpts == nil && o.ClientSecret == "" {
89+ return errors.New("auth: client secret must be provided")
92+ return errors.New("auth: auth URL must be provided")
94+ if o.TokenURL == "" {
95+ return errors.New("auth: token URL must be provided")
97+ if o.AuthStyle == StyleUnknown {
98+ return errors.New("auth: auth style must be provided")
100+ if o.AuthHandlerOpts == nil && o.RefreshToken == "" {
101+ return errors.New("auth: refresh token must be provided")
106+func (o *Options3LO) logger() *slog.Logger {
107+ return internallog.New(o.Logger)
110+// PKCEOptions holds parameters to support PKCE.
111+type PKCEOptions struct {
112+ // Challenge is the un-padded, base64-url-encoded string of the encrypted code verifier.
113+ Challenge string // The un-padded, base64-url-encoded string of the encrypted code verifier.
114+ // ChallengeMethod is the encryption method (ex. S256).
115+ ChallengeMethod string
116+ // Verifier is the original, non-encrypted secret.
117+ Verifier string // The original, non-encrypted secret.
120+type tokenJSON struct {
121+ AccessToken string `json:"access_token"`
122+ TokenType string `json:"token_type"`
123+ RefreshToken string `json:"refresh_token"`
124+ ExpiresIn int `json:"expires_in"`
126+ ErrorCode string `json:"error"`
127+ ErrorDescription string `json:"error_description"`
128+ ErrorURI string `json:"error_uri"`
131+func (e *tokenJSON) expiry() (t time.Time) {
132+ if v := e.ExpiresIn; v != 0 {
133+ return time.Now().Add(time.Duration(v) * time.Second)
138+func (o *Options3LO) client() *http.Client {
139+ if o.Client != nil {
142+ return internal.DefaultClient()
145+// authCodeURL returns a URL that points to a OAuth2 consent page.
146+func (o *Options3LO) authCodeURL(state string, values url.Values) string {
147+ var buf bytes.Buffer
148+ buf.WriteString(o.AuthURL)
150+ "response_type": {"code"},
151+ "client_id": {o.ClientID},
153+ if o.RedirectURL != "" {
154+ v.Set("redirect_uri", o.RedirectURL)
156+ if len(o.Scopes) > 0 {
157+ v.Set("scope", strings.Join(o.Scopes, " "))
160+ v.Set("state", state)
162+ if o.AuthHandlerOpts != nil {
163+ if o.AuthHandlerOpts.PKCEOpts != nil &&
164+ o.AuthHandlerOpts.PKCEOpts.Challenge != "" {
165+ v.Set(codeChallengeKey, o.AuthHandlerOpts.PKCEOpts.Challenge)
167+ if o.AuthHandlerOpts.PKCEOpts != nil &&
168+ o.AuthHandlerOpts.PKCEOpts.ChallengeMethod != "" {
169+ v.Set(codeChallengeMethodKey, o.AuthHandlerOpts.PKCEOpts.ChallengeMethod)
172+ for k := range values {
175+ if strings.Contains(o.AuthURL, "?") {
180+ buf.WriteString(v.Encode())
184+// New3LOTokenProvider returns a [TokenProvider] based on the 3-legged OAuth2
185+// configuration. The TokenProvider is caches and auto-refreshes tokens by
187+func New3LOTokenProvider(opts *Options3LO) (TokenProvider, error) {
188+ if err := opts.validate(); err != nil {
191+ if opts.AuthHandlerOpts != nil {
192+ return new3LOTokenProviderWithAuthHandler(opts), nil
194+ return NewCachedTokenProvider(&tokenProvider3LO{opts: opts, refreshToken: opts.RefreshToken, client: opts.client()}, &CachedTokenProviderOptions{
195+ ExpireEarly: opts.EarlyTokenExpiry,
199+// AuthorizationHandlerOptions provides a set of options to specify for doing a
200+// 3-legged OAuth2 flow with a custom [AuthorizationHandler].
201+type AuthorizationHandlerOptions struct {
202+ // AuthorizationHandler specifies the handler used to for the authorization
203+ // part of the flow.
204+ Handler AuthorizationHandler
205+ // State is used verify that the "state" is identical in the request and
206+ // response before exchanging the auth code for OAuth2 token.
208+ // PKCEOpts allows setting configurations for PKCE. Optional.
209+ PKCEOpts *PKCEOptions
212+func new3LOTokenProviderWithAuthHandler(opts *Options3LO) TokenProvider {
213+ return NewCachedTokenProvider(&tokenProviderWithHandler{opts: opts, state: opts.AuthHandlerOpts.State}, &CachedTokenProviderOptions{
214+ ExpireEarly: opts.EarlyTokenExpiry,
218+// exchange handles the final exchange portion of the 3lo flow. Returns a Token,
219+// refreshToken, and error.
220+func (o *Options3LO) exchange(ctx context.Context, code string) (*Token, string, error) {
223+ "grant_type": {"authorization_code"},
226+ if o.RedirectURL != "" {
227+ v.Set("redirect_uri", o.RedirectURL)
229+ if o.AuthHandlerOpts != nil &&
230+ o.AuthHandlerOpts.PKCEOpts != nil &&
231+ o.AuthHandlerOpts.PKCEOpts.Verifier != "" {
232+ v.Set(codeVerifierKey, o.AuthHandlerOpts.PKCEOpts.Verifier)
234+ for k := range o.URLParams {
235+ v.Set(k, o.URLParams.Get(k))
237+ return fetchToken(ctx, o, v)
240+// This struct is not safe for concurrent access alone, but the way it is used
241+// in this package by wrapping it with a cachedTokenProvider makes it so.
242+type tokenProvider3LO struct {
248+func (tp *tokenProvider3LO) Token(ctx context.Context) (*Token, error) {
249+ if tp.refreshToken == "" {
250+ return nil, errors.New("auth: token expired and refresh token is not set")
253+ "grant_type": {"refresh_token"},
254+ "refresh_token": {tp.refreshToken},
256+ for k := range tp.opts.URLParams {
257+ v.Set(k, tp.opts.URLParams.Get(k))
260+ tk, rt, err := fetchToken(ctx, tp.opts, v)
264+ if tp.refreshToken != rt && rt != "" {
265+ tp.refreshToken = rt
270+type tokenProviderWithHandler struct {
275+func (tp tokenProviderWithHandler) Token(ctx context.Context) (*Token, error) {
276+ url := tp.opts.authCodeURL(tp.state, nil)
277+ code, state, err := tp.opts.AuthHandlerOpts.Handler(url)
281+ if state != tp.state {
282+ return nil, errors.New("auth: state mismatch in 3-legged-OAuth flow")
284+ tok, _, err := tp.opts.exchange(ctx, code)
288+// fetchToken returns a Token, refresh token, and/or an error.
289+func fetchToken(ctx context.Context, o *Options3LO, v url.Values) (*Token, string, error) {
290+ var refreshToken string
291+ if o.AuthStyle == StyleInParams {
292+ if o.ClientID != "" {
293+ v.Set("client_id", o.ClientID)
295+ if o.ClientSecret != "" {
296+ v.Set("client_secret", o.ClientSecret)
299+ req, err := http.NewRequestWithContext(ctx, "POST", o.TokenURL, strings.NewReader(v.Encode()))
301+ return nil, refreshToken, err
303+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
304+ if o.AuthStyle == StyleInHeader {
305+ req.SetBasicAuth(url.QueryEscape(o.ClientID), url.QueryEscape(o.ClientSecret))
307+ logger := o.logger()
309+ logger.DebugContext(ctx, "3LO token request", "request", internallog.HTTPRequest(req, []byte(v.Encode())))
311+ resp, body, err := internal.DoRequest(o.client(), req)
313+ return nil, refreshToken, err
315+ logger.DebugContext(ctx, "3LO token response", "response", internallog.HTTPResponse(resp, body))
316+ failureStatus := resp.StatusCode < 200 || resp.StatusCode > 299
323+ // errors ignored because of default switch on content
324+ content, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
326+ case "application/x-www-form-urlencoded", "text/plain":
327+ // some endpoints return a query string
328+ vals, err := url.ParseQuery(string(body))
331+ return nil, refreshToken, tokError
333+ return nil, refreshToken, fmt.Errorf("auth: cannot parse response: %w", err)
335+ tokError.code = vals.Get("error")
336+ tokError.description = vals.Get("error_description")
337+ tokError.uri = vals.Get("error_uri")
339+ Value: vals.Get("access_token"),
340+ Type: vals.Get("token_type"),
341+ Metadata: make(map[string]interface{}, len(vals)),
343+ for k, v := range vals {
344+ token.Metadata[k] = v
346+ refreshToken = vals.Get("refresh_token")
347+ e := vals.Get("expires_in")
348+ expires, _ := strconv.Atoi(e)
350+ token.Expiry = time.Now().Add(time.Duration(expires) * time.Second)
354+ if err = json.Unmarshal(body, &tj); err != nil {
356+ return nil, refreshToken, tokError
358+ return nil, refreshToken, fmt.Errorf("auth: cannot parse json: %w", err)
360+ tokError.code = tj.ErrorCode
361+ tokError.description = tj.ErrorDescription
362+ tokError.uri = tj.ErrorURI
364+ Value: tj.AccessToken,
366+ Expiry: tj.expiry(),
367+ Metadata: make(map[string]interface{}),
369+ json.Unmarshal(body, &token.Metadata) // optional field, skip err check
370+ refreshToken = tj.RefreshToken
372+ // according to spec, servers should respond status 400 in error case
373+ // https://www.rfc-editor.org/rfc/rfc6749#section-5.2
374+ // but some unorthodox servers respond 200 in error case
375+ if failureStatus || tokError.code != "" {
376+ return nil, refreshToken, tokError
378+ if token.Value == "" {
379+ return nil, refreshToken, errors.New("auth: server response missing access_token")
381+ return token, refreshToken, nil
vendor/cloud.google.com/go/civil/civil.gonew file+350
@@ -0,0 +1,350 @@
1+// Copyright 2016 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package civil implements types for civil time, a time-zone-independent
16+// representation of time that follows the rules of the proleptic
17+// Gregorian calendar with exactly 24-hour days, 60-minute hours, and 60-second
20+// Because they lack location information, these types do not represent unique
21+// moments or intervals of time. Use time.Time for that purpose.
29+// A Date represents a date (year, month, day).
31+// This type does not include location information, and therefore does not
32+// describe a unique 24-hour timespan.
34+ Year int // Year (e.g., 2014).
35+ Month time.Month // Month of the year (January = 1, ...).
36+ Day int // Day of the month, starting at 1.
39+// DateOf returns the Date in which a time occurs in that time's location.
40+func DateOf(t time.Time) Date {
42+ d.Year, d.Month, d.Day = t.Date()
46+// ParseDate parses a string in RFC3339 full-date format and returns the date value it represents.
47+func ParseDate(s string) (Date, error) {
48+ t, err := time.Parse("2006-01-02", s)
52+ return DateOf(t), nil
55+// String returns the date in RFC3339 full-date format.
56+func (d Date) String() string {
57+ return fmt.Sprintf("%04d-%02d-%02d", d.Year, d.Month, d.Day)
60+// IsValid reports whether the date is valid.
61+func (d Date) IsValid() bool {
62+ return DateOf(d.In(time.UTC)) == d
65+// In returns the time corresponding to time 00:00:00 of the date in the location.
67+// In is always consistent with time.Date, even when time.Date returns a time
68+// on a different day. For example, if loc is America/Indiana/Vincennes, then both
70+// time.Date(1955, time.May, 1, 0, 0, 0, 0, loc)
74+// civil.Date{Year: 1955, Month: time.May, Day: 1}.In(loc)
76+// return 23:00:00 on April 30, 1955.
78+// In panics if loc is nil.
79+func (d Date) In(loc *time.Location) time.Time {
80+ return time.Date(d.Year, d.Month, d.Day, 0, 0, 0, 0, loc)
83+// AddDays returns the date that is n days in the future.
84+// n can also be negative to go into the past.
85+func (d Date) AddDays(n int) Date {
86+ return DateOf(d.In(time.UTC).AddDate(0, 0, n))
89+// DaysSince returns the signed number of days between the date and s, not including the end day.
90+// This is the inverse operation to AddDays.
91+func (d Date) DaysSince(s Date) (days int) {
92+ // We convert to Unix time so we do not have to worry about leap seconds:
93+ // Unix time increases by exactly 86400 seconds per day.
94+ deltaUnix := d.In(time.UTC).Unix() - s.In(time.UTC).Unix()
95+ return int(deltaUnix / 86400)
98+// Before reports whether d occurs before d2.
99+func (d Date) Before(d2 Date) bool {
100+ if d.Year != d2.Year {
101+ return d.Year < d2.Year
103+ if d.Month != d2.Month {
104+ return d.Month < d2.Month
106+ return d.Day < d2.Day
109+// After reports whether d occurs after d2.
110+func (d Date) After(d2 Date) bool {
114+// Compare compares d and d2. If d is before d2, it returns -1;
115+// if d is after d2, it returns +1; otherwise it returns 0.
116+func (d Date) Compare(d2 Date) int {
119+ } else if d.After(d2) {
125+// IsZero reports whether date fields are set to their default value.
126+func (d Date) IsZero() bool {
127+ return (d.Year == 0) && (int(d.Month) == 0) && (d.Day == 0)
130+// MarshalText implements the encoding.TextMarshaler interface.
131+// The output is the result of d.String().
132+func (d Date) MarshalText() ([]byte, error) {
133+ return []byte(d.String()), nil
136+// UnmarshalText implements the encoding.TextUnmarshaler interface.
137+// The date is expected to be a string in a format accepted by ParseDate.
138+func (d *Date) UnmarshalText(data []byte) error {
140+ *d, err = ParseDate(string(data))
144+// A Time represents a time with nanosecond precision.
146+// This type does not include location information, and therefore does not
147+// describe a unique moment in time.
149+// This type exists to represent the TIME type in storage-based APIs like BigQuery.
150+// Most operations on Times are unlikely to be meaningful. Prefer the DateTime type.
152+ Hour int // The hour of the day in 24-hour format; range [0-23]
153+ Minute int // The minute of the hour; range [0-59]
154+ Second int // The second of the minute; range [0-59]
155+ Nanosecond int // The nanosecond of the second; range [0-999999999]
158+// TimeOf returns the Time representing the time of day in which a time occurs
159+// in that time's location. It ignores the date.
160+func TimeOf(t time.Time) Time {
162+ tm.Hour, tm.Minute, tm.Second = t.Clock()
163+ tm.Nanosecond = t.Nanosecond()
167+// ParseTime parses a string and returns the time value it represents.
168+// ParseTime accepts an extended form of the RFC3339 partial-time format. After
169+// the HH:MM:SS part of the string, an optional fractional part may appear,
170+// consisting of a decimal point followed by one to nine decimal digits.
171+// (RFC3339 admits only one digit after the decimal point).
172+func ParseTime(s string) (Time, error) {
173+ t, err := time.Parse("15:04:05.999999999", s)
177+ return TimeOf(t), nil
180+// String returns the date in the format described in ParseTime. If Nanoseconds
181+// is zero, no fractional part will be generated. Otherwise, the result will
182+// end with a fractional part consisting of a decimal point and nine digits.
183+func (t Time) String() string {
184+ s := fmt.Sprintf("%02d:%02d:%02d", t.Hour, t.Minute, t.Second)
185+ if t.Nanosecond == 0 {
188+ return s + fmt.Sprintf(".%09d", t.Nanosecond)
191+// IsValid reports whether the time is valid.
192+func (t Time) IsValid() bool {
193+ // Construct a non-zero time.
194+ tm := time.Date(2, 2, 2, t.Hour, t.Minute, t.Second, t.Nanosecond, time.UTC)
195+ return TimeOf(tm) == t
198+// IsZero reports whether time fields are set to their default value.
199+func (t Time) IsZero() bool {
200+ return (t.Hour == 0) && (t.Minute == 0) && (t.Second == 0) && (t.Nanosecond == 0)
203+// Before reports whether t occurs before t2.
204+func (t Time) Before(t2 Time) bool {
205+ if t.Hour != t2.Hour {
206+ return t.Hour < t2.Hour
208+ if t.Minute != t2.Minute {
209+ return t.Minute < t2.Minute
211+ if t.Second != t2.Second {
212+ return t.Second < t2.Second
215+ return t.Nanosecond < t2.Nanosecond
218+// After reports whether t occurs after t2.
219+func (t Time) After(t2 Time) bool {
223+// Compare compares t and t2. If t is before t2, it returns -1;
224+// if t is after t2, it returns +1; otherwise it returns 0.
225+func (t Time) Compare(t2 Time) int {
228+ } else if t.After(t2) {
234+// MarshalText implements the encoding.TextMarshaler interface.
235+// The output is the result of t.String().
236+func (t Time) MarshalText() ([]byte, error) {
237+ return []byte(t.String()), nil
240+// UnmarshalText implements the encoding.TextUnmarshaler interface.
241+// The time is expected to be a string in a format accepted by ParseTime.
242+func (t *Time) UnmarshalText(data []byte) error {
244+ *t, err = ParseTime(string(data))
248+// A DateTime represents a date and time.
250+// This type does not include location information, and therefore does not
251+// describe a unique moment in time.
252+type DateTime struct {
257+// Note: We deliberately do not embed Date into DateTime, to avoid promoting AddDays and Sub.
259+// DateTimeOf returns the DateTime in which a time occurs in that time's location.
260+func DateTimeOf(t time.Time) DateTime {
267+// ParseDateTime parses a string and returns the DateTime it represents.
268+// ParseDateTime accepts a variant of the RFC3339 date-time format that omits
269+// the time offset but includes an optional fractional time, as described in
270+// ParseTime. Informally, the accepted format is
272+// YYYY-MM-DDTHH:MM:SS[.FFFFFFFFF]
274+// where the 'T' may be a lower-case 't'.
275+func ParseDateTime(s string) (DateTime, error) {
276+ t, err := time.Parse("2006-01-02T15:04:05.999999999", s)
278+ t, err = time.Parse("2006-01-02t15:04:05.999999999", s)
280+ return DateTime{}, err
283+ return DateTimeOf(t), nil
286+// String returns the date in the format described in ParseDate.
287+func (dt DateTime) String() string {
288+ return dt.Date.String() + "T" + dt.Time.String()
291+// IsValid reports whether the datetime is valid.
292+func (dt DateTime) IsValid() bool {
293+ return dt.Date.IsValid() && dt.Time.IsValid()
296+// In returns the time corresponding to the DateTime in the given location.
298+// If the time is missing or ambigous at the location, In returns the same
299+// result as time.Date. For example, if loc is America/Indiana/Vincennes, then
302+// time.Date(1955, time.May, 1, 0, 30, 0, 0, loc)
307+// civil.Date{Year: 1955, Month: time.May, Day: 1}},
308+// civil.Time{Minute: 30}}.In(loc)
310+// return 23:30:00 on April 30, 1955.
312+// In panics if loc is nil.
313+func (dt DateTime) In(loc *time.Location) time.Time {
314+ return time.Date(dt.Date.Year, dt.Date.Month, dt.Date.Day, dt.Time.Hour, dt.Time.Minute, dt.Time.Second, dt.Time.Nanosecond, loc)
317+// Before reports whether dt occurs before dt2.
318+func (dt DateTime) Before(dt2 DateTime) bool {
319+ return dt.In(time.UTC).Before(dt2.In(time.UTC))
322+// After reports whether dt occurs after dt2.
323+func (dt DateTime) After(dt2 DateTime) bool {
324+ return dt2.Before(dt)
327+// Compare compares dt and dt2. If dt is before dt2, it returns -1;
328+// if dt is after dt2, it returns +1; otherwise it returns 0.
329+func (dt DateTime) Compare(dt2 DateTime) int {
330+ return dt.In(time.UTC).Compare(dt2.In(time.UTC))
333+// IsZero reports whether datetime fields are set to their default value.
334+func (dt DateTime) IsZero() bool {
335+ return dt.Date.IsZero() && dt.Time.IsZero()
338+// MarshalText implements the encoding.TextMarshaler interface.
339+// The output is the result of dt.String().
340+func (dt DateTime) MarshalText() ([]byte, error) {
341+ return []byte(dt.String()), nil
344+// UnmarshalText implements the encoding.TextUnmarshaler interface.
345+// The datetime is expected to be a string in a format accepted by ParseDateTime
346+func (dt *DateTime) UnmarshalText(data []byte) error {
348+ *dt, err = ParseDateTime(string(data))
vendor/cloud.google.com/go/compute/metadata/CHANGES.mdnew file+66
@@ -0,0 +1,66 @@
3+## [0.6.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.2...compute/metadata/v0.6.0) (2024-12-13)
8+* **compute/metadata:** Add debug logging ([#11078](https://github.com/googleapis/google-cloud-go/issues/11078)) ([a816814](https://github.com/googleapis/google-cloud-go/commit/a81681463906e4473570a2f426eb0dc2de64e53f))
10+## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.1...compute/metadata/v0.5.2) (2024-09-20)
15+* **compute/metadata:** Close Response Body for failed request ([#10891](https://github.com/googleapis/google-cloud-go/issues/10891)) ([e91d45e](https://github.com/googleapis/google-cloud-go/commit/e91d45e4757a9e354114509ba9800085d9e0ff1f))
17+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.0...compute/metadata/v0.5.1) (2024-09-12)
22+* **compute/metadata:** Check error chain for retryable error ([#10840](https://github.com/googleapis/google-cloud-go/issues/10840)) ([2bdedef](https://github.com/googleapis/google-cloud-go/commit/2bdedeff621b223d63cebc4355fcf83bc68412cd))
24+## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10)
29+* **compute/metadata:** Add sys check for windows OnGCE ([#10521](https://github.com/googleapis/google-cloud-go/issues/10521)) ([3b9a830](https://github.com/googleapis/google-cloud-go/commit/3b9a83063960d2a2ac20beb47cc15818a68bd302))
31+## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.3.0...compute/metadata/v0.4.0) (2024-07-01)
36+* **compute/metadata:** Add context for all functions/methods ([#10370](https://github.com/googleapis/google-cloud-go/issues/10370)) ([66b8efe](https://github.com/googleapis/google-cloud-go/commit/66b8efe7ad877e052b2987bb4475477e38c67bb3))
41+* **compute/metadata:** Update OnGCE description ([#10408](https://github.com/googleapis/google-cloud-go/issues/10408)) ([6a46dca](https://github.com/googleapis/google-cloud-go/commit/6a46dca4eae4f88ec6f88822e01e5bf8aeca787f))
43+## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.3...compute/metadata/v0.3.0) (2024-04-15)
48+* **compute/metadata:** Add context aware functions ([#9733](https://github.com/googleapis/google-cloud-go/issues/9733)) ([e4eb5b4](https://github.com/googleapis/google-cloud-go/commit/e4eb5b46ee2aec9d2fc18300bfd66015e25a0510))
50+## [0.2.3](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.2...compute/metadata/v0.2.3) (2022-12-15)
55+* **compute/metadata:** Switch DNS lookup to an absolute lookup ([119b410](https://github.com/googleapis/google-cloud-go/commit/119b41060c7895e45e48aee5621ad35607c4d021)), refs [#7165](https://github.com/googleapis/google-cloud-go/issues/7165)
57+## [0.2.2](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.1...compute/metadata/v0.2.2) (2022-12-01)
62+* **compute/metadata:** Set IdleConnTimeout for http.Client ([#7084](https://github.com/googleapis/google-cloud-go/issues/7084)) ([766516a](https://github.com/googleapis/google-cloud-go/commit/766516aaf3816bfb3159efeea65aa3d1d205a3e2)), refs [#5430](https://github.com/googleapis/google-cloud-go/issues/5430)
64+## [0.1.0] (2022-10-26)
66+Initial release of metadata being it's own module.
vendor/cloud.google.com/go/compute/metadata/LICENSEnew file+202
@@ -0,0 +1,202 @@
3+ Version 2.0, January 2004
4+ http://www.apache.org/licenses/
6+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10+ "License" shall mean the terms and conditions for use, reproduction,
11+ and distribution as defined by Sections 1 through 9 of this document.
13+ "Licensor" shall mean the copyright owner or entity authorized by
14+ the copyright owner that is granting the License.
16+ "Legal Entity" shall mean the union of the acting entity and all
17+ other entities that control, are controlled by, or are under common
18+ control with that entity. For the purposes of this definition,
19+ "control" means (i) the power, direct or indirect, to cause the
20+ direction or management of such entity, whether by contract or
21+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22+ outstanding shares, or (iii) beneficial ownership of such entity.
24+ "You" (or "Your") shall mean an individual or Legal Entity
25+ exercising permissions granted by this License.
27+ "Source" form shall mean the preferred form for making modifications,
28+ including but not limited to software source code, documentation
29+ source, and configuration files.
31+ "Object" form shall mean any form resulting from mechanical
32+ transformation or translation of a Source form, including but
33+ not limited to compiled object code, generated documentation,
34+ and conversions to other media types.
36+ "Work" shall mean the work of authorship, whether in Source or
37+ Object form, made available under the License, as indicated by a
38+ copyright notice that is included in or attached to the work
39+ (an example is provided in the Appendix below).
41+ "Derivative Works" shall mean any work, whether in Source or Object
42+ form, that is based on (or derived from) the Work and for which the
43+ editorial revisions, annotations, elaborations, or other modifications
44+ represent, as a whole, an original work of authorship. For the purposes
45+ of this License, Derivative Works shall not include works that remain
46+ separable from, or merely link (or bind by name) to the interfaces of,
47+ the Work and Derivative Works thereof.
49+ "Contribution" shall mean any work of authorship, including
50+ the original version of the Work and any modifications or additions
51+ to that Work or Derivative Works thereof, that is intentionally
52+ submitted to Licensor for inclusion in the Work by the copyright owner
53+ or by an individual or Legal Entity authorized to submit on behalf of
54+ the copyright owner. For the purposes of this definition, "submitted"
55+ means any form of electronic, verbal, or written communication sent
56+ to the Licensor or its representatives, including but not limited to
57+ communication on electronic mailing lists, source code control systems,
58+ and issue tracking systems that are managed by, or on behalf of, the
59+ Licensor for the purpose of discussing and improving the Work, but
60+ excluding communication that is conspicuously marked or otherwise
61+ designated in writing by the copyright owner as "Not a Contribution."
63+ "Contributor" shall mean Licensor and any individual or Legal Entity
64+ on behalf of whom a Contribution has been received by Licensor and
65+ subsequently incorporated within the Work.
67+ 2. Grant of Copyright License. Subject to the terms and conditions of
68+ this License, each Contributor hereby grants to You a perpetual,
69+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70+ copyright license to reproduce, prepare Derivative Works of,
71+ publicly display, publicly perform, sublicense, and distribute the
72+ Work and such Derivative Works in Source or Object form.
74+ 3. Grant of Patent License. Subject to the terms and conditions of
75+ this License, each Contributor hereby grants to You a perpetual,
76+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77+ (except as stated in this section) patent license to make, have made,
78+ use, offer to sell, sell, import, and otherwise transfer the Work,
79+ where such license applies only to those patent claims licensable
80+ by such Contributor that are necessarily infringed by their
81+ Contribution(s) alone or by combination of their Contribution(s)
82+ with the Work to which such Contribution(s) was submitted. If You
83+ institute patent litigation against any entity (including a
84+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85+ or a Contribution incorporated within the Work constitutes direct
86+ or contributory patent infringement, then any patent licenses
87+ granted to You under this License for that Work shall terminate
88+ as of the date such litigation is filed.
90+ 4. Redistribution. You may reproduce and distribute copies of the
91+ Work or Derivative Works thereof in any medium, with or without
92+ modifications, and in Source or Object form, provided that You
93+ meet the following conditions:
95+ (a) You must give any other recipients of the Work or
96+ Derivative Works a copy of this License; and
98+ (b) You must cause any modified files to carry prominent notices
99+ stating that You changed the files; and
101+ (c) You must retain, in the Source form of any Derivative Works
102+ that You distribute, all copyright, patent, trademark, and
103+ attribution notices from the Source form of the Work,
104+ excluding those notices that do not pertain to any part of
105+ the Derivative Works; and
107+ (d) If the Work includes a "NOTICE" text file as part of its
108+ distribution, then any Derivative Works that You distribute must
109+ include a readable copy of the attribution notices contained
110+ within such NOTICE file, excluding those notices that do not
111+ pertain to any part of the Derivative Works, in at least one
112+ of the following places: within a NOTICE text file distributed
113+ as part of the Derivative Works; within the Source form or
114+ documentation, if provided along with the Derivative Works; or,
115+ within a display generated by the Derivative Works, if and
116+ wherever such third-party notices normally appear. The contents
117+ of the NOTICE file are for informational purposes only and
118+ do not modify the License. You may add Your own attribution
119+ notices within Derivative Works that You distribute, alongside
120+ or as an addendum to the NOTICE text from the Work, provided
121+ that such additional attribution notices cannot be construed
122+ as modifying the License.
124+ You may add Your own copyright statement to Your modifications and
125+ may provide additional or different license terms and conditions
126+ for use, reproduction, or distribution of Your modifications, or
127+ for any such Derivative Works as a whole, provided Your use,
128+ reproduction, and distribution of the Work otherwise complies with
129+ the conditions stated in this License.
131+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132+ any Contribution intentionally submitted for inclusion in the Work
133+ by You to the Licensor shall be under the terms and conditions of
134+ this License, without any additional terms or conditions.
135+ Notwithstanding the above, nothing herein shall supersede or modify
136+ the terms of any separate license agreement you may have executed
137+ with Licensor regarding such Contributions.
139+ 6. Trademarks. This License does not grant permission to use the trade
140+ names, trademarks, service marks, or product names of the Licensor,
141+ except as required for reasonable and customary use in describing the
142+ origin of the Work and reproducing the content of the NOTICE file.
144+ 7. Disclaimer of Warranty. Unless required by applicable law or
145+ agreed to in writing, Licensor provides the Work (and each
146+ Contributor provides its Contributions) on an "AS IS" BASIS,
147+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148+ implied, including, without limitation, any warranties or conditions
149+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150+ PARTICULAR PURPOSE. You are solely responsible for determining the
151+ appropriateness of using or redistributing the Work and assume any
152+ risks associated with Your exercise of permissions under this License.
154+ 8. Limitation of Liability. In no event and under no legal theory,
155+ whether in tort (including negligence), contract, or otherwise,
156+ unless required by applicable law (such as deliberate and grossly
157+ negligent acts) or agreed to in writing, shall any Contributor be
158+ liable to You for damages, including any direct, indirect, special,
159+ incidental, or consequential damages of any character arising as a
160+ result of this License or out of the use or inability to use the
161+ Work (including but not limited to damages for loss of goodwill,
162+ work stoppage, computer failure or malfunction, or any and all
163+ other commercial damages or losses), even if such Contributor
164+ has been advised of the possibility of such damages.
166+ 9. Accepting Warranty or Additional Liability. While redistributing
167+ the Work or Derivative Works thereof, You may choose to offer,
168+ and charge a fee for, acceptance of support, warranty, indemnity,
169+ or other liability obligations and/or rights consistent with this
170+ License. However, in accepting such obligations, You may act only
171+ on Your own behalf and on Your sole responsibility, not on behalf
172+ of any other Contributor, and only if You agree to indemnify,
173+ defend, and hold each Contributor harmless for any liability
174+ incurred by, or claims asserted against, such Contributor by reason
175+ of your accepting any such warranty or additional liability.
177+ END OF TERMS AND CONDITIONS
179+ APPENDIX: How to apply the Apache License to your work.
181+ To apply the Apache License to your work, attach the following
182+ boilerplate notice, with the fields enclosed by brackets "[]"
183+ replaced with your own identifying information. (Don't include
184+ the brackets!) The text should be enclosed in the appropriate
185+ comment syntax for the file format. We also recommend that a
186+ file or class name and description of purpose be included on the
187+ same "printed page" as the copyright notice for easier
188+ identification within third-party archives.
190+ Copyright [yyyy] [name of copyright owner]
192+ Licensed under the Apache License, Version 2.0 (the "License");
193+ you may not use this file except in compliance with the License.
194+ You may obtain a copy of the License at
196+ http://www.apache.org/licenses/LICENSE-2.0
198+ Unless required by applicable law or agreed to in writing, software
199+ distributed under the License is distributed on an "AS IS" BASIS,
200+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201+ See the License for the specific language governing permissions and
202+ limitations under the License.
vendor/cloud.google.com/go/compute/metadata/README.mdnew file+27
@@ -0,0 +1,27 @@
3+[](https://pkg.go.dev/cloud.google.com/go/compute/metadata)
5+This is a utility library for communicating with Google Cloud metadata service
11+go get cloud.google.com/go/compute/metadata
16+See the [Go Versions Supported](https://github.com/googleapis/google-cloud-go#go-versions-supported)
17+section in the root directory's README.
21+Contributions are welcome. Please, see the [CONTRIBUTING](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md)
24+Please note that this project is released with a Contributor Code of Conduct.
25+By participating in this project you agree to abide by its terms. See
26+[Contributor Code of Conduct](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/main/CONTRIBUTING.md#contributor-code-of-conduct)
vendor/cloud.google.com/go/compute/metadata/log.gonew file+149
@@ -0,0 +1,149 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
27+// Code below this point is copied from github.com/googleapis/gax-go/v2/internallog
28+// to avoid the dependency. The compute/metadata module is used by too many
29+// non-client library modules that can't justify the dependency.
31+// The handler returned if logging is not enabled.
32+type noOpHandler struct{}
34+func (h noOpHandler) Enabled(_ context.Context, _ slog.Level) bool {
38+func (h noOpHandler) Handle(_ context.Context, _ slog.Record) error {
42+func (h noOpHandler) WithAttrs(_ []slog.Attr) slog.Handler {
46+func (h noOpHandler) WithGroup(_ string) slog.Handler {
50+// httpRequest returns a lazily evaluated [slog.LogValuer] for a
51+// [http.Request] and the associated body.
52+func httpRequest(req *http.Request, body []byte) slog.LogValuer {
64+func (r *request) LogValue() slog.Value {
65+ if r == nil || r.req == nil {
68+ var groupValueAttrs []slog.Attr
69+ groupValueAttrs = append(groupValueAttrs, slog.String("method", r.req.Method))
70+ groupValueAttrs = append(groupValueAttrs, slog.String("url", r.req.URL.String()))
72+ var headerAttr []slog.Attr
73+ for k, val := range r.req.Header {
74+ headerAttr = append(headerAttr, slog.String(k, strings.Join(val, ",")))
76+ if len(headerAttr) > 0 {
77+ groupValueAttrs = append(groupValueAttrs, slog.Any("headers", headerAttr))
80+ if len(r.payload) > 0 {
81+ if attr, ok := processPayload(r.payload); ok {
82+ groupValueAttrs = append(groupValueAttrs, attr)
85+ return slog.GroupValue(groupValueAttrs...)
88+// httpResponse returns a lazily evaluated [slog.LogValuer] for a
89+// [http.Response] and the associated body.
90+func httpResponse(resp *http.Response, body []byte) slog.LogValuer {
97+type response struct {
102+func (r *response) LogValue() slog.Value {
106+ var groupValueAttrs []slog.Attr
107+ groupValueAttrs = append(groupValueAttrs, slog.String("status", fmt.Sprint(r.resp.StatusCode)))
109+ var headerAttr []slog.Attr
110+ for k, val := range r.resp.Header {
111+ headerAttr = append(headerAttr, slog.String(k, strings.Join(val, ",")))
113+ if len(headerAttr) > 0 {
114+ groupValueAttrs = append(groupValueAttrs, slog.Any("headers", headerAttr))
117+ if len(r.payload) > 0 {
118+ if attr, ok := processPayload(r.payload); ok {
119+ groupValueAttrs = append(groupValueAttrs, attr)
122+ return slog.GroupValue(groupValueAttrs...)
125+func processPayload(payload []byte) (slog.Attr, bool) {
126+ peekChar := payload[0]
127+ if peekChar == '{' {
129+ var m map[string]any
130+ if err := json.Unmarshal(payload, &m); err == nil {
131+ return slog.Any("payload", m), true
133+ } else if peekChar == '[' {
136+ if err := json.Unmarshal(payload, &m); err == nil {
137+ return slog.Any("payload", m), true
141+ buf := &bytes.Buffer{}
142+ if err := json.Compact(buf, payload); err != nil {
143+ // Write raw payload incase of error
146+ return slog.String("payload", buf.String()), true
148+ return slog.Attr{}, false
vendor/cloud.google.com/go/compute/metadata/metadata.gonew file+872
@@ -0,0 +1,872 @@
1+// Copyright 2014 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+// Package metadata provides access to Google Compute Engine (GCE)
16+// metadata and API service accounts.
18+// This package is a wrapper around the GCE metadata service,
19+// as documented at https://cloud.google.com/compute/docs/metadata/overview.
20+package metadata // import "cloud.google.com/go/compute/metadata"
38+ // metadataIP is the documented metadata server IP address.
39+ metadataIP = "169.254.169.254"
41+ // metadataHostEnv is the environment variable specifying the
42+ // GCE metadata hostname. If empty, the default value of
43+ // metadataIP ("169.254.169.254") is used instead.
44+ // This is variable name is not defined by any spec, as far as
45+ // I know; it was made up for the Go package.
46+ metadataHostEnv = "GCE_METADATA_HOST"
48+ userAgent = "gcloud-golang/0.1"
51+type cachedValue struct {
59+ projID = &cachedValue{k: "project/project-id", trim: true}
60+ projNum = &cachedValue{k: "project/numeric-project-id", trim: true}
61+ instID = &cachedValue{k: "instance/id", trim: true}
64+var defaultClient = &Client{
65+ hc: newDefaultHTTPClient(),
66+ logger: slog.New(noOpHandler{}),
69+func newDefaultHTTPClient() *http.Client {
71+ Transport: &http.Transport{
73+ Timeout: 2 * time.Second,
74+ KeepAlive: 30 * time.Second,
76+ IdleConnTimeout: 60 * time.Second,
78+ Timeout: 5 * time.Second,
82+// NotDefinedError is returned when requested metadata is not defined.
84+// The underlying string is the suffix after "/computeMetadata/v1/".
86+// This error is not returned if the value is defined to be the empty
88+type NotDefinedError string
90+func (suffix NotDefinedError) Error() string {
91+ return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix))
94+func (c *cachedValue) get(ctx context.Context, cl *Client) (v string, err error) {
101+ v, err = cl.getTrimmed(ctx, c.k)
103+ v, err = cl.GetWithContext(ctx, c.k)
116+// OnGCE reports whether this process is running on Google Compute Platforms.
117+// NOTE: True returned from `OnGCE` does not guarantee that the metadata server
118+// is accessible from this process and have all the metadata defined.
120+ onGCEOnce.Do(initOnGCE)
128+func testOnGCE() bool {
129+ // The user explicitly said they're on GCE, so trust them.
130+ if os.Getenv(metadataHostEnv) != "" {
134+ ctx, cancel := context.WithCancel(context.Background())
137+ resc := make(chan bool, 2)
139+ // Try two strategies in parallel.
140+ // See https://github.com/googleapis/google-cloud-go/issues/194
142+ req, _ := http.NewRequest("GET", "http://"+metadataIP, nil)
143+ req.Header.Set("User-Agent", userAgent)
144+ res, err := newDefaultHTTPClient().Do(req.WithContext(ctx))
149+ defer res.Body.Close()
150+ resc <- res.Header.Get("Metadata-Flavor") == "Google"
154+ resolver := &net.Resolver{}
155+ addrs, err := resolver.LookupHost(ctx, "metadata.google.internal.")
156+ if err != nil || len(addrs) == 0 {
160+ resc <- strsContains(addrs, metadataIP)
163+ tryHarder := systemInfoSuggestsGCE()
167+ // The first strategy succeeded, so let's use it.
170+ // Wait for either the DNS or metadata server probe to
171+ // contradict the other one and say we are running on
172+ // GCE. Give it a lot of time to do so, since the system
173+ // info already suggests we're running on a GCE BIOS.
174+ timer := time.NewTimer(5 * time.Second)
180+ // Too slow. Who knows what this system is.
185+ // There's no hint from the system info that we're running on
186+ // GCE, so use the first probe's result as truth, whether it's
187+ // true or false. The goal here is to optimize for speed for
188+ // users who are NOT running on GCE. We can't assume that
189+ // either a DNS lookup or an HTTP request to a blackholed IP
190+ // address is fast. Worst case this should return when the
191+ // metaClient's Transport.ResponseHeaderTimeout or
192+ // Transport.Dial.Timeout fires (in two seconds).
196+// Subscribe calls Client.SubscribeWithContext on the default client.
198+// Deprecated: Please use the context aware variant [SubscribeWithContext].
199+func Subscribe(suffix string, fn func(v string, ok bool) error) error {
200+ return defaultClient.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })
203+// SubscribeWithContext calls Client.SubscribeWithContext on the default client.
204+func SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error {
205+ return defaultClient.SubscribeWithContext(ctx, suffix, fn)
208+// Get calls Client.GetWithContext on the default client.
210+// Deprecated: Please use the context aware variant [GetWithContext].
211+func Get(suffix string) (string, error) {
212+ return defaultClient.GetWithContext(context.Background(), suffix)
215+// GetWithContext calls Client.GetWithContext on the default client.
216+func GetWithContext(ctx context.Context, suffix string) (string, error) {
217+ return defaultClient.GetWithContext(ctx, suffix)
220+// ProjectID returns the current instance's project ID string.
222+// Deprecated: Please use the context aware variant [ProjectIDWithContext].
223+func ProjectID() (string, error) {
224+ return defaultClient.ProjectIDWithContext(context.Background())
227+// ProjectIDWithContext returns the current instance's project ID string.
228+func ProjectIDWithContext(ctx context.Context) (string, error) {
229+ return defaultClient.ProjectIDWithContext(ctx)
232+// NumericProjectID returns the current instance's numeric project ID.
234+// Deprecated: Please use the context aware variant [NumericProjectIDWithContext].
235+func NumericProjectID() (string, error) {
236+ return defaultClient.NumericProjectIDWithContext(context.Background())
239+// NumericProjectIDWithContext returns the current instance's numeric project ID.
240+func NumericProjectIDWithContext(ctx context.Context) (string, error) {
241+ return defaultClient.NumericProjectIDWithContext(ctx)
244+// InternalIP returns the instance's primary internal IP address.
246+// Deprecated: Please use the context aware variant [InternalIPWithContext].
247+func InternalIP() (string, error) {
248+ return defaultClient.InternalIPWithContext(context.Background())
251+// InternalIPWithContext returns the instance's primary internal IP address.
252+func InternalIPWithContext(ctx context.Context) (string, error) {
253+ return defaultClient.InternalIPWithContext(ctx)
256+// ExternalIP returns the instance's primary external (public) IP address.
258+// Deprecated: Please use the context aware variant [ExternalIPWithContext].
259+func ExternalIP() (string, error) {
260+ return defaultClient.ExternalIPWithContext(context.Background())
263+// ExternalIPWithContext returns the instance's primary external (public) IP address.
264+func ExternalIPWithContext(ctx context.Context) (string, error) {
265+ return defaultClient.ExternalIPWithContext(ctx)
268+// Email calls Client.EmailWithContext on the default client.
270+// Deprecated: Please use the context aware variant [EmailWithContext].
271+func Email(serviceAccount string) (string, error) {
272+ return defaultClient.EmailWithContext(context.Background(), serviceAccount)
275+// EmailWithContext calls Client.EmailWithContext on the default client.
276+func EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
277+ return defaultClient.EmailWithContext(ctx, serviceAccount)
280+// Hostname returns the instance's hostname. This will be of the form
281+// "<instanceID>.c.<projID>.internal".
283+// Deprecated: Please use the context aware variant [HostnameWithContext].
284+func Hostname() (string, error) {
285+ return defaultClient.HostnameWithContext(context.Background())
288+// HostnameWithContext returns the instance's hostname. This will be of the form
289+// "<instanceID>.c.<projID>.internal".
290+func HostnameWithContext(ctx context.Context) (string, error) {
291+ return defaultClient.HostnameWithContext(ctx)
294+// InstanceTags returns the list of user-defined instance tags,
295+// assigned when initially creating a GCE instance.
297+// Deprecated: Please use the context aware variant [InstanceTagsWithContext].
298+func InstanceTags() ([]string, error) {
299+ return defaultClient.InstanceTagsWithContext(context.Background())
302+// InstanceTagsWithContext returns the list of user-defined instance tags,
303+// assigned when initially creating a GCE instance.
304+func InstanceTagsWithContext(ctx context.Context) ([]string, error) {
305+ return defaultClient.InstanceTagsWithContext(ctx)
308+// InstanceID returns the current VM's numeric instance ID.
310+// Deprecated: Please use the context aware variant [InstanceIDWithContext].
311+func InstanceID() (string, error) {
312+ return defaultClient.InstanceIDWithContext(context.Background())
315+// InstanceIDWithContext returns the current VM's numeric instance ID.
316+func InstanceIDWithContext(ctx context.Context) (string, error) {
317+ return defaultClient.InstanceIDWithContext(ctx)
320+// InstanceName returns the current VM's instance ID string.
322+// Deprecated: Please use the context aware variant [InstanceNameWithContext].
323+func InstanceName() (string, error) {
324+ return defaultClient.InstanceNameWithContext(context.Background())
327+// InstanceNameWithContext returns the current VM's instance ID string.
328+func InstanceNameWithContext(ctx context.Context) (string, error) {
329+ return defaultClient.InstanceNameWithContext(ctx)
332+// Zone returns the current VM's zone, such as "us-central1-b".
334+// Deprecated: Please use the context aware variant [ZoneWithContext].
335+func Zone() (string, error) {
336+ return defaultClient.ZoneWithContext(context.Background())
339+// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
340+func ZoneWithContext(ctx context.Context) (string, error) {
341+ return defaultClient.ZoneWithContext(ctx)
344+// InstanceAttributes calls Client.InstanceAttributesWithContext on the default client.
346+// Deprecated: Please use the context aware variant [InstanceAttributesWithContext.
347+func InstanceAttributes() ([]string, error) {
348+ return defaultClient.InstanceAttributesWithContext(context.Background())
351+// InstanceAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
352+func InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
353+ return defaultClient.InstanceAttributesWithContext(ctx)
356+// ProjectAttributes calls Client.ProjectAttributesWithContext on the default client.
358+// Deprecated: Please use the context aware variant [ProjectAttributesWithContext].
359+func ProjectAttributes() ([]string, error) {
360+ return defaultClient.ProjectAttributesWithContext(context.Background())
363+// ProjectAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
364+func ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
365+ return defaultClient.ProjectAttributesWithContext(ctx)
368+// InstanceAttributeValue calls Client.InstanceAttributeValueWithContext on the default client.
370+// Deprecated: Please use the context aware variant [InstanceAttributeValueWithContext].
371+func InstanceAttributeValue(attr string) (string, error) {
372+ return defaultClient.InstanceAttributeValueWithContext(context.Background(), attr)
375+// InstanceAttributeValueWithContext calls Client.InstanceAttributeValueWithContext on the default client.
376+func InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
377+ return defaultClient.InstanceAttributeValueWithContext(ctx, attr)
380+// ProjectAttributeValue calls Client.ProjectAttributeValueWithContext on the default client.
382+// Deprecated: Please use the context aware variant [ProjectAttributeValueWithContext].
383+func ProjectAttributeValue(attr string) (string, error) {
384+ return defaultClient.ProjectAttributeValueWithContext(context.Background(), attr)
387+// ProjectAttributeValueWithContext calls Client.ProjectAttributeValueWithContext on the default client.
388+func ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
389+ return defaultClient.ProjectAttributeValueWithContext(ctx, attr)
392+// Scopes calls Client.ScopesWithContext on the default client.
394+// Deprecated: Please use the context aware variant [ScopesWithContext].
395+func Scopes(serviceAccount string) ([]string, error) {
396+ return defaultClient.ScopesWithContext(context.Background(), serviceAccount)
399+// ScopesWithContext calls Client.ScopesWithContext on the default client.
400+func ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
401+ return defaultClient.ScopesWithContext(ctx, serviceAccount)
404+func strsContains(ss []string, s string) bool {
405+ for _, v := range ss {
413+// A Client provides metadata.
419+// Options for configuring a [Client].
420+type Options struct {
421+ // Client is the HTTP client used to make requests. Optional.
423+ // Logger is used to log information about HTTP request and responses.
424+ // If not provided, nothing will be logged. Optional.
428+// NewClient returns a Client that can be used to fetch metadata.
429+// Returns the client that uses the specified http.Client for HTTP requests.
430+// If nil is specified, returns the default client.
431+func NewClient(c *http.Client) *Client {
432+ return NewWithOptions(&Options{
437+// NewWithOptions returns a Client that is configured with the provided Options.
438+func NewWithOptions(opts *Options) *Client {
440+ return defaultClient
442+ client := opts.Client
444+ client = newDefaultHTTPClient()
446+ logger := opts.Logger
448+ logger = slog.New(noOpHandler{})
450+ return &Client{hc: client, logger: logger}
453+// getETag returns a value from the metadata service as well as the associated ETag.
454+// This func is otherwise equivalent to Get.
455+func (c *Client) getETag(ctx context.Context, suffix string) (value, etag string, err error) {
456+ // Using a fixed IP makes it very difficult to spoof the metadata service in
457+ // a container, which is an important use-case for local testing of cloud
458+ // deployments. To enable spoofing of the metadata service, the environment
459+ // variable GCE_METADATA_HOST is first inspected to decide where metadata
460+ // requests shall go.
461+ host := os.Getenv(metadataHostEnv)
463+ // Using 169.254.169.254 instead of "metadata" here because Go
464+ // binaries built with the "netgo" tag and without cgo won't
465+ // know the search suffix for "metadata" is
466+ // ".google.internal", and this IP address is documented as
467+ // being stable anyway.
470+ suffix = strings.TrimLeft(suffix, "/")
471+ u := "http://" + host + "/computeMetadata/v1/" + suffix
472+ req, err := http.NewRequestWithContext(ctx, "GET", u, nil)
476+ req.Header.Set("Metadata-Flavor", "Google")
477+ req.Header.Set("User-Agent", userAgent)
478+ var res *http.Response
481+ retryer := newRetryer()
483+ c.logger.DebugContext(ctx, "metadata request", "request", httpRequest(req, nil))
484+ res, reqErr = c.hc.Do(req)
487+ code = res.StatusCode
488+ body, err = io.ReadAll(res.Body)
493+ c.logger.DebugContext(ctx, "metadata response", "response", httpResponse(res, body))
496+ if delay, shouldRetry := retryer.Retry(code, reqErr); shouldRetry {
497+ if res != nil && res.Body != nil {
500+ if err := sleep(ctx, delay); err != nil {
508+ return "", "", reqErr
510+ if res.StatusCode == http.StatusNotFound {
511+ return "", "", NotDefinedError(suffix)
513+ if res.StatusCode != 200 {
514+ return "", "", &Error{Code: res.StatusCode, Message: string(body)}
516+ return string(body), res.Header.Get("Etag"), nil
519+// Get returns a value from the metadata service.
520+// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
522+// If the GCE_METADATA_HOST environment variable is not defined, a default of
523+// 169.254.169.254 will be used instead.
525+// If the requested metadata is not defined, the returned error will
526+// be of type NotDefinedError.
528+// Deprecated: Please use the context aware variant [Client.GetWithContext].
529+func (c *Client) Get(suffix string) (string, error) {
530+ return c.GetWithContext(context.Background(), suffix)
533+// GetWithContext returns a value from the metadata service.
534+// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
536+// If the GCE_METADATA_HOST environment variable is not defined, a default of
537+// 169.254.169.254 will be used instead.
539+// If the requested metadata is not defined, the returned error will
540+// be of type NotDefinedError.
542+// NOTE: Without an extra deadline in the context this call can take in the
543+// worst case, with internal backoff retries, up to 15 seconds (e.g. when server
544+// is responding slowly). Pass context with additional timeouts when needed.
545+func (c *Client) GetWithContext(ctx context.Context, suffix string) (string, error) {
546+ val, _, err := c.getETag(ctx, suffix)
550+func (c *Client) getTrimmed(ctx context.Context, suffix string) (s string, err error) {
551+ s, err = c.GetWithContext(ctx, suffix)
552+ s = strings.TrimSpace(s)
556+func (c *Client) lines(ctx context.Context, suffix string) ([]string, error) {
557+ j, err := c.GetWithContext(ctx, suffix)
561+ s := strings.Split(strings.TrimSpace(j), "\n")
563+ s[i] = strings.TrimSpace(s[i])
568+// ProjectID returns the current instance's project ID string.
570+// Deprecated: Please use the context aware variant [Client.ProjectIDWithContext].
571+func (c *Client) ProjectID() (string, error) { return c.ProjectIDWithContext(context.Background()) }
573+// ProjectIDWithContext returns the current instance's project ID string.
574+func (c *Client) ProjectIDWithContext(ctx context.Context) (string, error) { return projID.get(ctx, c) }
576+// NumericProjectID returns the current instance's numeric project ID.
578+// Deprecated: Please use the context aware variant [Client.NumericProjectIDWithContext].
579+func (c *Client) NumericProjectID() (string, error) {
580+ return c.NumericProjectIDWithContext(context.Background())
583+// NumericProjectIDWithContext returns the current instance's numeric project ID.
584+func (c *Client) NumericProjectIDWithContext(ctx context.Context) (string, error) {
585+ return projNum.get(ctx, c)
588+// InstanceID returns the current VM's numeric instance ID.
590+// Deprecated: Please use the context aware variant [Client.InstanceIDWithContext].
591+func (c *Client) InstanceID() (string, error) {
592+ return c.InstanceIDWithContext(context.Background())
595+// InstanceIDWithContext returns the current VM's numeric instance ID.
596+func (c *Client) InstanceIDWithContext(ctx context.Context) (string, error) {
597+ return instID.get(ctx, c)
600+// InternalIP returns the instance's primary internal IP address.
602+// Deprecated: Please use the context aware variant [Client.InternalIPWithContext].
603+func (c *Client) InternalIP() (string, error) {
604+ return c.InternalIPWithContext(context.Background())
607+// InternalIPWithContext returns the instance's primary internal IP address.
608+func (c *Client) InternalIPWithContext(ctx context.Context) (string, error) {
609+ return c.getTrimmed(ctx, "instance/network-interfaces/0/ip")
612+// Email returns the email address associated with the service account.
614+// Deprecated: Please use the context aware variant [Client.EmailWithContext].
615+func (c *Client) Email(serviceAccount string) (string, error) {
616+ return c.EmailWithContext(context.Background(), serviceAccount)
619+// EmailWithContext returns the email address associated with the service account.
620+// The serviceAccount parameter default value (empty string or "default" value)
621+// will use the instance's main account.
622+func (c *Client) EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
623+ if serviceAccount == "" {
624+ serviceAccount = "default"
626+ return c.getTrimmed(ctx, "instance/service-accounts/"+serviceAccount+"/email")
629+// ExternalIP returns the instance's primary external (public) IP address.
631+// Deprecated: Please use the context aware variant [Client.ExternalIPWithContext].
632+func (c *Client) ExternalIP() (string, error) {
633+ return c.ExternalIPWithContext(context.Background())
636+// ExternalIPWithContext returns the instance's primary external (public) IP address.
637+func (c *Client) ExternalIPWithContext(ctx context.Context) (string, error) {
638+ return c.getTrimmed(ctx, "instance/network-interfaces/0/access-configs/0/external-ip")
641+// Hostname returns the instance's hostname. This will be of the form
642+// "<instanceID>.c.<projID>.internal".
644+// Deprecated: Please use the context aware variant [Client.HostnameWithContext].
645+func (c *Client) Hostname() (string, error) {
646+ return c.HostnameWithContext(context.Background())
649+// HostnameWithContext returns the instance's hostname. This will be of the form
650+// "<instanceID>.c.<projID>.internal".
651+func (c *Client) HostnameWithContext(ctx context.Context) (string, error) {
652+ return c.getTrimmed(ctx, "instance/hostname")
655+// InstanceTags returns the list of user-defined instance tags.
657+// Deprecated: Please use the context aware variant [Client.InstanceTagsWithContext].
658+func (c *Client) InstanceTags() ([]string, error) {
659+ return c.InstanceTagsWithContext(context.Background())
662+// InstanceTagsWithContext returns the list of user-defined instance tags,
663+// assigned when initially creating a GCE instance.
664+func (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) {
666+ j, err := c.GetWithContext(ctx, "instance/tags")
670+ if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil {
676+// InstanceName returns the current VM's instance ID string.
678+// Deprecated: Please use the context aware variant [Client.InstanceNameWithContext].
679+func (c *Client) InstanceName() (string, error) {
680+ return c.InstanceNameWithContext(context.Background())
683+// InstanceNameWithContext returns the current VM's instance ID string.
684+func (c *Client) InstanceNameWithContext(ctx context.Context) (string, error) {
685+ return c.getTrimmed(ctx, "instance/name")
688+// Zone returns the current VM's zone, such as "us-central1-b".
690+// Deprecated: Please use the context aware variant [Client.ZoneWithContext].
691+func (c *Client) Zone() (string, error) {
692+ return c.ZoneWithContext(context.Background())
695+// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
696+func (c *Client) ZoneWithContext(ctx context.Context) (string, error) {
697+ zone, err := c.getTrimmed(ctx, "instance/zone")
698+ // zone is of the form "projects/<projNum>/zones/<zoneName>".
702+ return zone[strings.LastIndex(zone, "/")+1:], nil
705+// InstanceAttributes returns the list of user-defined attributes,
706+// assigned when initially creating a GCE VM instance. The value of an
707+// attribute can be obtained with InstanceAttributeValue.
709+// Deprecated: Please use the context aware variant [Client.InstanceAttributesWithContext].
710+func (c *Client) InstanceAttributes() ([]string, error) {
711+ return c.InstanceAttributesWithContext(context.Background())
714+// InstanceAttributesWithContext returns the list of user-defined attributes,
715+// assigned when initially creating a GCE VM instance. The value of an
716+// attribute can be obtained with InstanceAttributeValue.
717+func (c *Client) InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
718+ return c.lines(ctx, "instance/attributes/")
721+// ProjectAttributes returns the list of user-defined attributes
722+// applying to the project as a whole, not just this VM. The value of
723+// an attribute can be obtained with ProjectAttributeValue.
725+// Deprecated: Please use the context aware variant [Client.ProjectAttributesWithContext].
726+func (c *Client) ProjectAttributes() ([]string, error) {
727+ return c.ProjectAttributesWithContext(context.Background())
730+// ProjectAttributesWithContext returns the list of user-defined attributes
731+// applying to the project as a whole, not just this VM. The value of
732+// an attribute can be obtained with ProjectAttributeValue.
733+func (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
734+ return c.lines(ctx, "project/attributes/")
737+// InstanceAttributeValue returns the value of the provided VM
738+// instance attribute.
740+// If the requested attribute is not defined, the returned error will
741+// be of type NotDefinedError.
743+// InstanceAttributeValue may return ("", nil) if the attribute was
744+// defined to be the empty string.
746+// Deprecated: Please use the context aware variant [Client.InstanceAttributeValueWithContext].
747+func (c *Client) InstanceAttributeValue(attr string) (string, error) {
748+ return c.InstanceAttributeValueWithContext(context.Background(), attr)
751+// InstanceAttributeValueWithContext returns the value of the provided VM
752+// instance attribute.
754+// If the requested attribute is not defined, the returned error will
755+// be of type NotDefinedError.
757+// InstanceAttributeValue may return ("", nil) if the attribute was
758+// defined to be the empty string.
759+func (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
760+ return c.GetWithContext(ctx, "instance/attributes/"+attr)
763+// ProjectAttributeValue returns the value of the provided
764+// project attribute.
766+// If the requested attribute is not defined, the returned error will
767+// be of type NotDefinedError.
769+// ProjectAttributeValue may return ("", nil) if the attribute was
770+// defined to be the empty string.
772+// Deprecated: Please use the context aware variant [Client.ProjectAttributeValueWithContext].
773+func (c *Client) ProjectAttributeValue(attr string) (string, error) {
774+ return c.ProjectAttributeValueWithContext(context.Background(), attr)
777+// ProjectAttributeValueWithContext returns the value of the provided
778+// project attribute.
780+// If the requested attribute is not defined, the returned error will
781+// be of type NotDefinedError.
783+// ProjectAttributeValue may return ("", nil) if the attribute was
784+// defined to be the empty string.
785+func (c *Client) ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
786+ return c.GetWithContext(ctx, "project/attributes/"+attr)
789+// Scopes returns the service account scopes for the given account.
790+// The account may be empty or the string "default" to use the instance's
793+// Deprecated: Please use the context aware variant [Client.ScopesWithContext].
794+func (c *Client) Scopes(serviceAccount string) ([]string, error) {
795+ return c.ScopesWithContext(context.Background(), serviceAccount)
798+// ScopesWithContext returns the service account scopes for the given account.
799+// The account may be empty or the string "default" to use the instance's
801+func (c *Client) ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
802+ if serviceAccount == "" {
803+ serviceAccount = "default"
805+ return c.lines(ctx, "instance/service-accounts/"+serviceAccount+"/scopes")
808+// Subscribe subscribes to a value from the metadata service.
809+// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
810+// The suffix may contain query parameters.
812+// Deprecated: Please use the context aware variant [Client.SubscribeWithContext].
813+func (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error {
814+ return c.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })
817+// SubscribeWithContext subscribes to a value from the metadata service.
818+// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
819+// The suffix may contain query parameters.
821+// SubscribeWithContext calls fn with the latest metadata value indicated by the
822+// provided suffix. If the metadata value is deleted, fn is called with the
823+// empty string and ok false. Subscribe blocks until fn returns a non-nil error
824+// or the value is deleted. Subscribe returns the error value returned from the
825+// last call to fn, which may be nil when ok == false.
826+func (c *Client) SubscribeWithContext(ctx context.Context, suffix string, fn func(ctx context.Context, v string, ok bool) error) error {
827+ const failedSubscribeSleep = time.Second * 5
829+ // First check to see if the metadata value exists at all.
830+ val, lastETag, err := c.getETag(ctx, suffix)
835+ if err := fn(ctx, val, true); err != nil {
840+ if strings.ContainsRune(suffix, '?') {
841+ suffix += "&wait_for_change=true&last_etag="
843+ suffix += "?wait_for_change=true&last_etag="
846+ val, etag, err := c.getETag(ctx, suffix+url.QueryEscape(lastETag))
848+ if _, deleted := err.(NotDefinedError); !deleted {
849+ time.Sleep(failedSubscribeSleep)
850+ continue // Retry on other errors.
856+ if err := fn(ctx, val, ok); err != nil || !ok {
862+// Error contains an error response from the server.
864+ // Code is the HTTP response status code.
866+ // Message is the server response message.
870+func (e *Error) Error() string {
871+ return fmt.Sprintf("compute: Received %d `%s`", e.Code, e.Message)
vendor/cloud.google.com/go/compute/metadata/retry.gonew file+114
@@ -0,0 +1,114 @@
1+// Copyright 2021 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
30+ syscallRetryable = func(error) bool { return false }
33+// defaultBackoff is basically equivalent to gax.Backoff without the need for
35+type defaultBackoff struct {
41+func (b *defaultBackoff) Pause() time.Duration {
42+ d := time.Duration(1 + rand.Int63n(int64(b.cur)))
43+ b.cur = time.Duration(float64(b.cur) * b.mul)
50+// sleep is the equivalent of gax.Sleep without the need for the dependency.
51+func sleep(ctx context.Context, d time.Duration) error {
52+ t := time.NewTimer(d)
62+func newRetryer() *metadataRetryer {
63+ return &metadataRetryer{bo: &defaultBackoff{
64+ cur: 100 * time.Millisecond,
65+ max: 30 * time.Second,
70+type backoff interface {
71+ Pause() time.Duration
74+type metadataRetryer struct {
79+func (r *metadataRetryer) Retry(status int, err error) (time.Duration, bool) {
80+ if status == http.StatusOK {
83+ retryOk := shouldRetry(status, err)
87+ if r.attempts == maxRetryAttempts {
91+ return r.bo.Pause(), true
94+func shouldRetry(status int, err error) bool {
95+ if 500 <= status && status <= 599 {
98+ if err == io.ErrUnexpectedEOF {
101+ // Transient network errors should be retried.
102+ if syscallRetryable(err) {
105+ if err, ok := err.(interface{ Temporary() bool }); ok {
106+ if err.Temporary() {
110+ if err, ok := err.(interface{ Unwrap() error }); ok {
111+ return shouldRetry(status, err.Unwrap())
vendor/cloud.google.com/go/compute/metadata/retry_linux.gonew file+31
@@ -0,0 +1,31 @@
1+// Copyright 2021 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
26+ // Initialize syscallRetryable to return true on transient socket-level
27+ // errors. These errors are specific to Linux.
28+ syscallRetryable = func(err error) bool {
29+ return errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.ECONNREFUSED)
vendor/cloud.google.com/go/compute/metadata/syscheck.gonew file+26
@@ -0,0 +1,26 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
15+//go:build !windows && !linux
19+// systemInfoSuggestsGCE reports whether the local system (without
20+// doing network requests) suggests that we're running on GCE. If this
21+// returns true, testOnGCE tries a bit harder to reach its metadata
23+func systemInfoSuggestsGCE() bool {
24+ // We don't currently have checks for other GOOS
vendor/cloud.google.com/go/compute/metadata/syscheck_linux.gonew file+28
@@ -0,0 +1,28 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
24+func systemInfoSuggestsGCE() bool {
25+ b, _ := os.ReadFile("/sys/class/dmi/id/product_name")
26+ name := strings.TrimSpace(string(b))
27+ return name == "Google" || name == "Google Compute Engine"
vendor/cloud.google.com/go/compute/metadata/syscheck_windows.gonew file+38
@@ -0,0 +1,38 @@
1+// Copyright 2024 Google LLC
3+// Licensed under the Apache License, Version 2.0 (the "License");
4+// you may not use this file except in compliance with the License.
5+// You may obtain a copy of the License at
7+// http://www.apache.org/licenses/LICENSE-2.0
9+// Unless required by applicable law or agreed to in writing, software
10+// distributed under the License is distributed on an "AS IS" BASIS,
11+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+// See the License for the specific language governing permissions and
13+// limitations under the License.
22+ "golang.org/x/sys/windows/registry"
25+func systemInfoSuggestsGCE() bool {
26+ k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\HardwareConfig\Current`, registry.QUERY_VALUE)
32+ s, _, err := k.GetStringValue("SystemProductName")
36+ s = strings.TrimSpace(s)
37+ return strings.HasPrefix(s, "Google")
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.mdnew file+849
@@ -0,0 +1,849 @@
7+* Added field `OperationLocationResultPath` to `runtime.NewPollerOptions[T]` for LROs that use the `Operation-Location` pattern.
8+* Support `encoding.TextMarshaler` and `encoding.TextUnmarshaler` interfaces in `arm.ResourceID`.
10+## 1.16.0 (2024-10-17)
14+* Added field `Kind` to `runtime.StartSpanOptions` to allow a kind to be set when starting a span.
18+* `BearerTokenPolicy` now rewinds request bodies before retrying
20+## 1.15.0 (2024-10-14)
24+* `BearerTokenPolicy` handles CAE claims challenges
28+* Omit the `ResponseError.RawResponse` field from JSON marshaling so instances can be marshaled.
29+* Fixed an integer overflow in the retry policy.
33+* Update dependencies.
35+## 1.14.0 (2024-08-07)
39+* Added field `Attributes` to `runtime.StartSpanOptions` to simplify creating spans with attributes.
43+* Include the HTTP verb and URL in `log.EventRetryPolicy` log entries so it's clear which operation is being retried.
45+## 1.13.0 (2024-07-16)
49+- Added runtime.NewRequestFromRequest(), allowing for a policy.Request to be created from an existing *http.Request.
51+## 1.12.0 (2024-06-06)
55+* Added field `StatusCodes` to `runtime.FetcherForNextLinkOptions` allowing for additional HTTP status codes indicating success.
56+* Added func `NewUUID` to the `runtime` package for generating UUIDs.
60+* Fixed an issue that prevented pollers using the `Operation-Location` strategy from unmarshaling the final result in some cases.
64+* Updated dependencies.
66+## 1.11.1 (2024-04-02)
70+* Pollers that use the `Location` header won't consider `http.StatusRequestTimeout` a terminal failure.
71+* `runtime.Poller[T].Result` won't consider non-terminal error responses as terminal.
73+## 1.11.0 (2024-04-01)
77+* Added `StatusCodes` to `arm/policy.RegistrationOptions` to allow supporting non-standard HTTP status codes during registration.
78+* Added field `InsecureAllowCredentialWithHTTP` to `azcore.ClientOptions` and dependent authentication pipeline policies.
79+* Added type `MultipartContent` to the `streaming` package to support multipart/form payloads with custom Content-Type and file name.
83+* `runtime.SetMultipartFormData` won't try to stringify `[]byte` values.
84+* Pollers that use the `Location` header won't consider `http.StatusTooManyRequests` a terminal failure.
88+* Update dependencies.
90+## 1.10.0 (2024-02-29)
94+* Added logging event `log.EventResponseError` that will contain the contents of `ResponseError.Error()` whenever an `azcore.ResponseError` is created.
95+* Added `runtime.NewResponseErrorWithErrorCode` for creating an `azcore.ResponseError` with a caller-supplied error code.
96+* Added type `MatchConditions` for use in conditional requests.
100+* Fixed a potential race condition between `NullValue` and `IsNullValue`.
101+* `runtime.EncodeQueryParams` will escape semicolons before calling `url.ParseQuery`.
105+* Update dependencies.
107+## 1.9.2 (2024-02-06)
111+* `runtime.MarshalAsByteArray` and `runtime.MarshalAsJSON` will preserve the preexisting value of the `Content-Type` header.
115+* Update to latest version of `internal`.
117+## 1.9.1 (2023-12-11)
121+* The `retry-after-ms` and `x-ms-retry-after-ms` headers weren't being checked during retries.
125+* Update dependencies.
127+## 1.9.0 (2023-11-06)
130+> These changes affect only code written against previous beta versions of `v1.7.0` and `v1.8.0`
131+* The function `NewTokenCredential` has been removed from the `fake` package. Use a literal `&fake.TokenCredential{}` instead.
132+* The field `TracingNamespace` in `runtime.PipelineOptions` has been replaced by `TracingOptions`.
136+* Fixed an issue that could cause some allowed HTTP header values to not show up in logs.
137+* Include error text instead of error type in traces when the transport returns an error.
138+* Fixed an issue that could cause an HTTP/2 request to hang when the TCP connection becomes unresponsive.
139+* Block key and SAS authentication for non TLS protected endpoints.
140+* Passing a `nil` credential value will no longer cause a panic. Instead, the authentication is skipped.
141+* Calling `Error` on a zero-value `azcore.ResponseError` will no longer panic.
142+* Fixed an issue in `fake.PagerResponder[T]` that would cause a trailing error to be omitted when iterating over pages.
143+* Context values created by `azcore` will no longer flow across disjoint HTTP requests.
147+* Skip generating trace info for no-op tracers.
148+* The `clientName` paramater in client constructors has been renamed to `moduleName`.
150+## 1.9.0-beta.1 (2023-10-05)
154+* The beta features for tracing and fakes have been reinstated.
156+## 1.8.0 (2023-10-05)
160+* This includes the following features from `v1.8.0-beta.N` releases.
161+ * Claims and CAE for authentication.
162+ * New `messaging` package.
163+ * Various helpers in the `runtime` package.
164+ * Deprecation of `runtime.With*` funcs and their replacements in the `policy` package.
165+* Added types `KeyCredential` and `SASCredential` to the `azcore` package.
166+ * Includes their respective constructor functions.
167+* Added types `KeyCredentialPolicy` and `SASCredentialPolicy` to the `azcore/runtime` package.
168+ * Includes their respective constructor functions and options types.
171+> These changes affect only code written against beta versions of `v1.8.0`
172+* The beta features for tracing and fakes have been omitted for this release.
176+* Fixed an issue that could cause some ARM RPs to not be automatically registered.
177+* Block bearer token authentication for non TLS protected endpoints.
181+* Updated dependencies.
183+## 1.8.0-beta.3 (2023-09-07)
187+* Added function `FetcherForNextLink` and `FetcherForNextLinkOptions` to the `runtime` package to centralize creation of `Pager[T].Fetcher` from a next link URL.
191+* Suppress creating spans for nested SDK API calls. The HTTP span will be a child of the outer API span.
195+* The following functions in the `runtime` package are now exposed from the `policy` package, and the `runtime` versions have been deprecated.
196+ * `WithCaptureResponse`
198+ * `WithRetryOptions`
200+## 1.7.2 (2023-09-06)
204+* Fix default HTTP transport to work in WASM modules.
206+## 1.8.0-beta.2 (2023-08-14)
210+* Added function `SanitizePagerPollerPath` to the `server` package to centralize sanitization and formalize the contract.
211+* Added `TokenRequestOptions.EnableCAE` to indicate whether to request a CAE token.
215+> This change affects only code written against beta version `v1.8.0-beta.1`.
216+* `messaging.CloudEvent` deserializes JSON objects as `[]byte`, instead of `json.RawMessage`. See the documentation for CloudEvent.Data for more information.
218+> This change affects only code written against beta versions `v1.7.0-beta.2` and `v1.8.0-beta.1`.
219+* Removed parameter from method `Span.End()` and its type `tracing.SpanEndOptions`. This API GA'ed in `v1.2.0` so we cannot change it.
223+* Propagate any query parameters when constructing a fake poller and/or injecting next links.
225+## 1.7.1 (2023-08-14)
229+* Enable TLS renegotiation in the default transport policy.
231+## 1.8.0-beta.1 (2023-07-12)
235+- `messaging/CloudEvent` allows you to serialize/deserialize CloudEvents, as described in the CloudEvents 1.0 specification: [link](https://github.com/cloudevents/spec)
239+* The beta features for CAE, tracing, and fakes have been reinstated.
241+## 1.7.0 (2023-07-12)
244+* Added method `WithClientName()` to type `azcore.Client` to support shallow cloning of a client with a new name used for tracing.
247+> These changes affect only code written against beta versions v1.7.0-beta.1 or v1.7.0-beta.2
248+* The beta features for CAE, tracing, and fakes have been omitted for this release.
250+## 1.7.0-beta.2 (2023-06-06)
253+> These changes affect only code written against beta version v1.7.0-beta.1
254+* Method `SpanFromContext()` on type `tracing.Tracer` had the `bool` return value removed.
255+ * This includes the field `SpanFromContext` in supporting type `tracing.TracerOptions`.
256+* Method `AddError()` has been removed from type `tracing.Span`.
257+* Method `Span.End()` now requires an argument of type `*tracing.SpanEndOptions`.
259+## 1.6.1 (2023-06-06)
262+* Fixed an issue in `azcore.NewClient()` and `arm.NewClient()` that could cause an incorrect module name to be used in telemetry.
265+* This version contains all bug fixes from `v1.7.0-beta.1`
267+## 1.7.0-beta.1 (2023-05-24)
270+* Restored CAE support for ARM clients.
271+* Added supporting features to enable distributed tracing.
272+ * Added func `runtime.StartSpan()` for use by SDKs to start spans.
273+ * Added method `WithContext()` to `runtime.Request` to support shallow cloning with a new context.
274+ * Added field `TracingNamespace` to `runtime.PipelineOptions`.
275+ * Added field `Tracer` to `runtime.NewPollerOptions` and `runtime.NewPollerFromResumeTokenOptions` types.
276+ * Added field `SpanFromContext` to `tracing.TracerOptions`.
277+ * Added methods `Enabled()`, `SetAttributes()`, and `SpanFromContext()` to `tracing.Tracer`.
278+ * Added supporting pipeline policies to include HTTP spans when creating clients.
279+* Added package `fake` to support generated fakes packages in SDKs.
280+ * The package contains public surface area exposed by fake servers and supporting APIs intended only for use by the fake server implementations.
281+ * Added an internal fake poller implementation.
284+* Retry policy always clones the underlying `*http.Request` before invoking the next policy.
285+* Added some non-standard error codes to the list of error codes for unregistered resource providers.
287+## 1.6.0 (2023-05-04)
290+* Added support for ARM cross-tenant authentication. Set the `AuxiliaryTenants` field of `arm.ClientOptions` to enable.
291+* Added `TenantID` field to `policy.TokenRequestOptions`.
293+## 1.5.0 (2023-04-06)
296+* Added `ShouldRetry` to `policy.RetryOptions` for finer-grained control over when to retry.
299+> These changes affect only code written against a beta version such as v1.5.0-beta.1
300+> These features will return in v1.6.0-beta.1.
301+* Removed `TokenRequestOptions.Claims` and `.TenantID`
302+* Removed ARM client support for CAE and cross-tenant auth.
305+* Added non-conformant LRO terminal states `Cancelled` and `Completed`.
308+* Updated to latest `internal` module.
310+## 1.5.0-beta.1 (2023-03-02)
313+* This release includes the features added in v1.4.0-beta.1
315+## 1.4.0 (2023-03-02)
316+> This release doesn't include features added in v1.4.0-beta.1. They will return in v1.5.0-beta.1.
319+* Add `Clone()` method for `arm/policy.ClientOptions`.
322+* ARM's RP registration policy will no longer swallow unrecognized errors.
323+* Fixed an issue in `runtime.NewPollerFromResumeToken()` when resuming a `Poller` with a custom `PollingHandler`.
324+* Fixed wrong policy copy in `arm/runtime.NewPipeline()`.
326+## 1.4.0-beta.1 (2023-02-02)
329+* Added support for ARM cross-tenant authentication. Set the `AuxiliaryTenants` field of `arm.ClientOptions` to enable.
330+* Added `Claims` and `TenantID` fields to `policy.TokenRequestOptions`.
331+* ARM bearer token policy handles CAE challenges.
333+## 1.3.1 (2023-02-02)
336+* Update dependencies to latest versions.
338+## 1.3.0 (2023-01-06)
341+* Added `BearerTokenOptions.AuthorizationHandler` to enable extending `runtime.BearerTokenPolicy`
342+ with custom authorization logic
343+* Added `Client` types and matching constructors to the `azcore` and `arm` packages. These represent a basic client for HTTP and ARM respectively.
346+* Updated `internal` module to latest version.
347+* `policy/Request.SetBody()` allows replacing a request's body with an empty one
349+## 1.2.0 (2022-11-04)
352+* Added `ClientOptions.APIVersion` field, which overrides the default version a client
353+ requests of the service, if the client supports this (all ARM clients do).
354+* Added package `tracing` that contains the building blocks for distributed tracing.
355+* Added field `TracingProvider` to type `policy.ClientOptions` that will be used to set the per-client tracing implementation.
358+* Fixed an issue in `runtime.SetMultipartFormData` to properly handle slices of `io.ReadSeekCloser`.
359+* Fixed the MaxRetryDelay default to be 60s.
360+* Failure to poll the state of an LRO will now return an `*azcore.ResponseError` for poller types that require this behavior.
361+* Fixed a bug in `runtime.NewPipeline` that would cause pipeline-specified allowed headers and query parameters to be lost.
364+* Retain contents of read-only fields when sending requests.
366+## 1.1.4 (2022-10-06)
369+* Don't retry a request if the `Retry-After` delay is greater than the configured `RetryOptions.MaxRetryDelay`.
370+* `runtime.JoinPaths`: do not unconditionally add a forward slash before the query string
373+* Removed logging URL from retry policy as it's redundant.
374+* Retry policy logs when it exits due to a non-retriable status code.
376+## 1.1.3 (2022-09-01)
379+* Adjusted the initial retry delay to 800ms per the Azure SDK guidelines.
381+## 1.1.2 (2022-08-09)
384+* Fixed various doc bugs.
386+## 1.1.1 (2022-06-30)
389+* Avoid polling when a RELO LRO synchronously terminates.
391+## 1.1.0 (2022-06-03)
394+* The one-second floor for `Frequency` when calling `PollUntilDone()` has been removed when running tests.
396+## 1.0.0 (2022-05-12)
399+* Added interface `runtime.PollingHandler` to support custom poller implementations.
400+ * Added field `PollingHandler` of this type to `runtime.NewPollerOptions[T]` and `runtime.NewPollerFromResumeTokenOptions[T]`.
403+* Renamed `cloud.Configuration.LoginEndpoint` to `.ActiveDirectoryAuthorityHost`
404+* Renamed `cloud.AzurePublicCloud` to `cloud.AzurePublic`
405+* Removed `AuxiliaryTenants` field from `arm/ClientOptions` and `arm/policy/BearerTokenOptions`
406+* Removed `TokenRequestOptions.TenantID`
407+* `Poller[T].PollUntilDone()` now takes an `options *PollUntilDoneOptions` param instead of `freq time.Duration`
408+* Removed `arm/runtime.Poller[T]`, `arm/runtime.NewPoller[T]()` and `arm/runtime.NewPollerFromResumeToken[T]()`
409+* Removed `arm/runtime.FinalStateVia` and related `const` values
410+* Renamed `runtime.PageProcessor` to `runtime.PagingHandler`
411+* The `arm/runtime.ProviderRepsonse` and `arm/runtime.Provider` types are no longer exported.
412+* Renamed `NewRequestIdPolicy()` to `NewRequestIDPolicy()`
413+* `TokenCredential.GetToken` now returns `AccessToken` by value.
416+* When per-try timeouts are enabled, only cancel the context after the body has been read and closed.
417+* The `Operation-Location` poller now properly handles `final-state-via` values.
418+* Improvements in `runtime.Poller[T]`
419+ * `Poll()` shouldn't cache errors, allowing for additional retries when in a non-terminal state.
420+ * `Result()` will cache the terminal result or error but not transient errors, allowing for additional retries.
423+* Updated to latest `internal` module and absorbed breaking changes.
424+ * Use `temporal.Resource` and deleted copy.
425+* The internal poller implementation has been refactored.
426+ * The implementation in `internal/pollers/poller.go` has been merged into `runtime/poller.go` with some slight modification.
427+ * The internal poller types had their methods updated to conform to the `runtime.PollingHandler` interface.
428+ * The creation of resume tokens has been refactored so that implementers of `runtime.PollingHandler` don't need to know about it.
429+* `NewPipeline()` places policies from `ClientOptions` after policies from `PipelineOptions`
430+* Default User-Agent headers no longer include `azcore` version information
432+## 0.23.1 (2022-04-14)
435+* Include XML header when marshalling XML content.
436+* Handle XML namespaces when searching for error code.
437+* Handle `odata.error` when searching for error code.
439+## 0.23.0 (2022-04-04)
442+* Added `runtime.Pager[T any]` and `runtime.Poller[T any]` supporting types for central, generic, implementations.
443+* Added `cloud` package with a new API for cloud configuration
444+* Added `FinalStateVia` field to `runtime.NewPollerOptions[T any]` type.
447+* Removed the `Poller` type-alias to the internal poller implementation.
448+* Added `Ptr[T any]` and `SliceOfPtrs[T any]` in the `to` package and removed all non-generic implementations.
449+* `NullValue` and `IsNullValue` now take a generic type parameter instead of an interface func parameter.
450+* Replaced `arm.Endpoint` with `cloud` API
451+ * Removed the `endpoint` parameter from `NewRPRegistrationPolicy()`
452+ * `arm/runtime.NewPipeline()` and `.NewRPRegistrationPolicy()` now return an `error`
453+* Refactored `NewPoller` and `NewPollerFromResumeToken` funcs in `arm/runtime` and `runtime` packages.
454+ * Removed the `pollerID` parameter as it's no longer required.
455+ * Created optional parameter structs and moved optional parameters into them.
456+* Changed `FinalStateVia` field to a `const` type.
459+* Converted expiring resource and dependent types to use generics.
461+## 0.22.0 (2022-03-03)
464+* Added header `WWW-Authenticate` to the default allow-list of headers for logging.
465+* Added a pipeline policy that enables the retrieval of HTTP responses from API calls.
466+ * Added `runtime.WithCaptureResponse` to enable the policy at the API level (off by default).
469+* Moved `WithHTTPHeader` and `WithRetryOptions` from the `policy` package to the `runtime` package.
471+## 0.21.1 (2022-02-04)
474+* Restore response body after reading in `Poller.FinalResponse()`. (#16911)
475+* Fixed bug in `NullValue` that could lead to incorrect comparisons for empty maps/slices (#16969)
478+* `BearerTokenPolicy` is more resilient to transient authentication failures. (#16789)
480+## 0.21.0 (2022-01-11)
483+* Added `AllowedHeaders` and `AllowedQueryParams` to `policy.LogOptions` to control which headers and query parameters are written to the logger.
484+* Added `azcore.ResponseError` type which is returned from APIs when a non-success HTTP status code is received.
487+* Moved `[]policy.Policy` parameters of `arm/runtime.NewPipeline` and `runtime.NewPipeline` into a new struct, `runtime.PipelineOptions`
488+* Renamed `arm/ClientOptions.Host` to `.Endpoint`
489+* Moved `Request.SkipBodyDownload` method to function `runtime.SkipBodyDownload`
490+* Removed `azcore.HTTPResponse` interface type
491+* `arm.NewPoller()` and `runtime.NewPoller()` no longer require an `eu` parameter
492+* `runtime.NewResponseError()` no longer requires an `error` parameter
494+## 0.20.0 (2021-10-22)
497+* Removed `arm.Connection`
498+* Removed `azcore.Credential` and `.NewAnonymousCredential()`
499+ * `NewRPRegistrationPolicy` now requires an `azcore.TokenCredential`
500+* `runtime.NewPipeline` has a new signature that simplifies implementing custom authentication
501+* `arm/runtime.RegistrationOptions` embeds `policy.ClientOptions`
502+* Contents in the `log` package have been slightly renamed.
503+* Removed `AuthenticationOptions` in favor of `policy.BearerTokenOptions`
504+* Changed parameters for `NewBearerTokenPolicy()`
505+* Moved policy config options out of `arm/runtime` and into `arm/policy`
508+* Updating Documentation
509+* Added string typdef `arm.Endpoint` to provide a hint toward expected ARM client endpoints
510+* `azcore.ClientOptions` contains common pipeline configuration settings
511+* Added support for multi-tenant authorization in `arm/runtime`
512+* Require one second minimum when calling `PollUntilDone()`
515+* Fixed a potential panic when creating the default Transporter.
516+* Close LRO initial response body when creating a poller.
517+* Fixed a panic when recursively cloning structs that contain time.Time.
519+## 0.19.0 (2021-08-25)
522+* Split content out of `azcore` into various packages. The intent is to separate content based on its usage (common, uncommon, SDK authors).
523+ * `azcore` has all core functionality.
524+ * `log` contains facilities for configuring in-box logging.
525+ * `policy` is used for configuring pipeline options and creating custom pipeline policies.
526+ * `runtime` contains various helpers used by SDK authors and generated content.
527+ * `streaming` has helpers for streaming IO operations.
528+* `NewTelemetryPolicy()` now requires module and version parameters and the `Value` option has been removed.
529+ * As a result, the `Request.Telemetry()` method has been removed.
530+* The telemetry policy now includes the SDK prefix `azsdk-go-` so callers no longer need to provide it.
531+* The `*http.Request` in `runtime.Request` is no longer anonymously embedded. Use the `Raw()` method to access it.
532+* The `UserAgent` and `Version` constants have been made internal, `Module` and `Version` respectively.
535+* Fixed an issue in the retry policy where the request body could be overwritten after a rewind.
538+* Moved modules `armcore` and `to` content into `arm` and `to` packages respectively.
539+ * The `Pipeline()` method on `armcore.Connection` has been replaced by `NewPipeline()` in `arm.Connection`. It takes module and version parameters used by the telemetry policy.
540+* Poller logic has been consolidated across ARM and core implementations.
541+ * This required some changes to the internal interfaces for core pollers.
542+* The core poller types have been improved, including more logging and test coverage.
544+## 0.18.1 (2021-08-20)
547+* Adds an `ETag` type for comparing etags and handling etags on requests
548+* Simplifies the `requestBodyProgess` and `responseBodyProgress` into a single `progress` object
551+* `JoinPaths` will preserve query parameters encoded in the `root` url.
554+* Bumps dependency on `internal` module to the latest version (v0.7.0)
556+## 0.18.0 (2021-07-29)
558+* Replaces methods from Logger type with two package methods for interacting with the logging functionality.
559+* `azcore.SetClassifications` replaces `azcore.Logger().SetClassifications`
560+* `azcore.SetListener` replaces `azcore.Logger().SetListener`
563+* Removes `Logger` type from `azcore`
566+## 0.17.0 (2021-07-27)
568+* Adding TenantID to TokenRequestOptions (https://github.com/Azure/azure-sdk-for-go/pull/14879)
569+* Adding AuxiliaryTenants to AuthenticationOptions (https://github.com/Azure/azure-sdk-for-go/pull/15123)
572+* Rename `AnonymousCredential` to `NewAnonymousCredential` (https://github.com/Azure/azure-sdk-for-go/pull/15104)
573+* rename `AuthenticationPolicyOptions` to `AuthenticationOptions` (https://github.com/Azure/azure-sdk-for-go/pull/15103)
574+* Make Header constants private (https://github.com/Azure/azure-sdk-for-go/pull/15038)
577+## 0.16.2 (2021-05-26)
579+* Improved support for byte arrays [#14715](https://github.com/Azure/azure-sdk-for-go/pull/14715)
582+## 0.16.1 (2021-05-19)
584+* Add license.txt to azcore module [#14682](https://github.com/Azure/azure-sdk-for-go/pull/14682)
587+## 0.16.0 (2021-05-07)
589+* Remove extra `*` in UnmarshalAsByteArray() [#14642](https://github.com/Azure/azure-sdk-for-go/pull/14642)
592+## 0.15.1 (2021-05-06)
594+* Cache the original request body on Request [#14634](https://github.com/Azure/azure-sdk-for-go/pull/14634)
597+## 0.15.0 (2021-05-05)
599+* Add support for null map and slice
600+* Export `Response.Payload` method
603+* remove `Response.UnmarshalError` as it's no longer required
606+## 0.14.5 (2021-04-23)
608+* Add `UnmarshalError()` on `azcore.Response`
611+## 0.14.4 (2021-04-22)
613+* Support for basic LRO polling
614+* Added type `LROPoller` and supporting types for basic polling on long running operations.
615+* rename poller param and added doc comment
618+* Fixed content type detection bug in logging.
621+## 0.14.3 (2021-03-29)
623+* Add support for multi-part form data
624+* Added method `WriteMultipartFormData()` to Request.
627+## 0.14.2 (2021-03-17)
629+* Add support for encoding JSON null values
630+* Adds `NullValue()` and `IsNullValue()` functions for setting and detecting sentinel values used for encoding a JSON null.
631+* Documentation fixes
634+* Fixed improper error wrapping
637+## 0.14.1 (2021-02-08)
639+* Add `Pager` and `Poller` interfaces to azcore
642+## 0.14.0 (2021-01-12)
644+* Accept zero-value options for default values
645+* Specify zero-value options structs to accept default values.
646+* Remove `DefaultXxxOptions()` methods.
647+* Do not silently change TryTimeout on negative values
648+* make per-try timeout opt-in
651+## 0.13.4 (2020-11-20)
653+* Include telemetry string in User Agent
656+## 0.13.3 (2020-11-20)
658+* Updating response body handling on `azcore.Response`
661+## 0.13.2 (2020-11-13)
663+* Remove implementation of stateless policies as first-class functions.
666+## 0.13.1 (2020-11-05)
668+* Add `Telemetry()` method to `azcore.Request()`
671+## 0.13.0 (2020-10-14)
673+* Rename `log` to `logger` to avoid name collision with the log package.
674+* Documentation improvements
675+* Simplified `DefaultHTTPClientTransport()` implementation
678+## 0.12.1 (2020-10-13)
680+* Update `internal` module dependence to `v0.5.0`
683+## 0.12.0 (2020-10-08)
685+* Removed storage specific content
686+* Removed internal content to prevent API clutter
687+* Refactored various policy options to conform with our options pattern
690+## 0.11.0 (2020-09-22)
693+* Removed `LogError` and `LogSlowResponse`.
694+* Renamed `options` in `RequestLogOptions`.
695+* Updated `NewRequestLogPolicy()` to follow standard pattern for options.
696+* Refactored `requestLogPolicy.Do()` per above changes.
697+* Cleaned up/added logging in retry policy.
698+* Export `NewResponseError()`
699+* Fix `RequestLogOptions` comment
702+## 0.10.1 (2020-09-17)
704+* Add default console logger
705+* Default console logger writes to stderr. To enable it, set env var `AZURE_SDK_GO_LOGGING` to the value 'all'.
706+* Added `Logger.Writef()` to reduce the need for `ShouldLog()` checks.
707+* Add `LogLongRunningOperation`
710+## 0.10.0 (2020-09-10)
712+* The `request` and `transport` interfaces have been refactored to align with the patterns in the standard library.
713+* `NewRequest()` now uses `http.NewRequestWithContext()` and performs additional validation, it also requires a context parameter.
714+* The `Policy` and `Transport` interfaces have had their context parameter removed as the context is associated with the underlying `http.Request`.
715+* `Pipeline.Do()` will validate the HTTP request before sending it through the pipeline, avoiding retries on a malformed request.
716+* The `Retrier` interface has been replaced with the `NonRetriableError` interface, and the retry policy updated to test for this.
717+* `Request.SetBody()` now requires a content type parameter for setting the request's MIME type.
718+* moved path concatenation into `JoinPaths()` func
721+## 0.9.6 (2020-08-18)
723+* Improvements to body download policy
724+* Always download the response body for error responses, i.e. HTTP status codes >= 400.
725+* Simplify variable declarations
728+## 0.9.5 (2020-08-11)
730+* Set the Content-Length header in `Request.SetBody`
733+## 0.9.4 (2020-08-03)
735+* Fix cancellation of per try timeout
736+* Per try timeout is used to ensure that an HTTP operation doesn't take too long, e.g. that a GET on some URL doesn't take an inordinant amount of time.
737+* Once the HTTP request returns, the per try timeout should be cancelled, not when the response has been read to completion.
738+* Do not drain response body if there are no more retries
739+* Do not retry non-idempotent operations when body download fails
742+## 0.9.3 (2020-07-28)
744+* Add support for custom HTTP request headers
745+* Inserts an internal policy into the pipeline that can extract HTTP header values from the caller's context, adding them to the request.
746+* Use `azcore.WithHTTPHeader` to add HTTP headers to a context.
747+* Remove method specific to Go 1.14
750+## 0.9.2 (2020-07-28)
752+* Omit read-only content from request payloads
753+* If any field in a payload's object graph contains `azure:"ro"`, make a clone of the object graph, omitting all fields with this annotation.
754+* Verify no fields were dropped
755+* Handle embedded struct types
756+* Added test for cloning by value
757+* Add messages to failures
760+## 0.9.1 (2020-07-22)
762+* Updated dependency on internal module to fix race condition.
765+## 0.9.0 (2020-07-09)
767+* Add `HTTPResponse` interface to be used by callers to access the raw HTTP response from an error in the event of an API call failure.
768+* Updated `sdk/internal` dependency to latest version.
769+* Rename package alias
772+## 0.8.2 (2020-06-29)
774+* Added missing documentation comments
777+* Fixed a bug in body download policy.
780+## 0.8.1 (2020-06-26)
782+* Miscellaneous clean-up reported by linters
785+## 0.8.0 (2020-06-01)
787+* Differentiate between standard and URL encoding.
790+## 0.7.1 (2020-05-27)
792+* Add support for for base64 encoding and decoding of payloads.
795+## 0.7.0 (2020-05-12)
797+* Change `RetryAfter()` to a function.
800+## 0.6.0 (2020-04-29)
802+* Updating `RetryAfter` to only return the detaion in the RetryAfter header
805+## 0.5.0 (2020-03-23)
807+* Export `TransportFunc`
810+* Removed `IterationDone`
813+## 0.4.1 (2020-02-25)
815+* Ensure per-try timeout is properly cancelled
816+* Explicitly call cancel the per-try timeout when the response body has been read/closed by the body download policy.
817+* When the response body is returned to the caller for reading/closing, wrap it in a `responseBodyReader` that will cancel the timeout when the body is closed.
818+* `Logger.Should()` will return false if no listener is set.
821+## 0.4.0 (2020-02-18)
823+* Enable custom `RetryOptions` to be specified per API call
824+* Added `WithRetryOptions()` that adds a custom `RetryOptions` to the provided context, allowing custom settings per API call.
825+* Remove 429 from the list of default HTTP status codes for retry.
826+* Change StatusCodesForRetry to a slice so consumers can append to it.
827+* Added support for retry-after in HTTP-date format.
828+* Cleaned up some comments specific to storage.
829+* Remove `Request.SetQueryParam()`
830+* Renamed `MaxTries` to `MaxRetries`
832+## 0.3.0 (2020-01-16)
834+* Added `DefaultRetryOptions` to create initialized default options.
837+* Removed `Response.CheckStatusCode()`
840+## 0.2.0 (2020-01-15)
842+* Add support for marshalling and unmarshalling JSON
843+* Removed `Response.Payload` field
844+* Exit early when unmarsahlling if there is no payload
847+## 0.1.0 (2020-01-10)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/LICENSE.txtnew file+21
@@ -0,0 +1,21 @@
3+Copyright (c) Microsoft Corporation.
5+Permission is hereby granted, free of charge, to any person obtaining a copy
6+of this software and associated documentation files (the "Software"), to deal
7+in the Software without restriction, including without limitation the rights
8+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+copies of the Software, and to permit persons to whom the Software is
10+furnished to do so, subject to the following conditions:
12+The above copyright notice and this permission notice shall be included in all
13+copies or substantial portions of the Software.
15+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/README.mdnew file+39
@@ -0,0 +1,39 @@
1+# Azure Core Client Module for Go
3+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore)
4+[](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=1843&branchName=main)
5+[](https://img.shields.io/azure-devops/coverage/azure-sdk/public/1843/main)
7+The `azcore` module provides a set of common interfaces and types for Go SDK client modules.
8+These modules follow the [Azure SDK Design Guidelines for Go](https://azure.github.io/azure-sdk/golang_introduction.html).
12+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
14+Typically, you will not need to explicitly install `azcore` as it will be installed as a client module dependency.
15+To add the latest version to your `go.mod` file, execute the following command.
18+go get github.com/Azure/azure-sdk-for-go/sdk/azcore
21+General documentation and examples can be found on [pkg.go.dev](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore).
24+This project welcomes contributions and suggestions. Most contributions require
25+you to agree to a Contributor License Agreement (CLA) declaring that you have
26+the right to, and actually do, grant us the rights to use your contribution.
27+For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
29+When you submit a pull request, a CLA-bot will automatically determine whether
30+you need to provide a CLA and decorate the PR appropriately (e.g., label,
31+comment). Simply follow the instructions provided by the bot. You will only
32+need to do this once across all repos using our CLA.
34+This project has adopted the
35+[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
36+For more information, see the
37+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
38+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
39+additional questions or comments.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.gonew file+239
@@ -0,0 +1,239 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
15+ providersKey = "providers"
16+ subscriptionsKey = "subscriptions"
17+ resourceGroupsLowerKey = "resourcegroups"
18+ locationsKey = "locations"
19+ builtInResourceNamespace = "Microsoft.Resources"
22+// RootResourceID defines the tenant as the root parent of all other ResourceID.
23+var RootResourceID = &ResourceID{
25+ ResourceType: TenantResourceType,
29+// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`.
30+// Don't create this type directly, use ParseResourceID instead.
31+type ResourceID struct {
32+ // Parent is the parent ResourceID of this instance.
33+ // Can be nil if there is no parent.
36+ // SubscriptionID is the subscription ID in this resource ID.
37+ // The value can be empty if the resource ID does not contain a subscription ID.
38+ SubscriptionID string
40+ // ResourceGroupName is the resource group name in this resource ID.
41+ // The value can be empty if the resource ID does not contain a resource group name.
42+ ResourceGroupName string
44+ // Provider represents the provider name in this resource ID.
45+ // This is only valid when the resource ID represents a resource provider.
46+ // Example: `/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights`
49+ // Location is the location in this resource ID.
50+ // The value can be empty if the resource ID does not contain a location name.
53+ // ResourceType represents the type of this resource ID.
54+ ResourceType ResourceType
56+ // Name is the resource name of this resource ID.
63+// ParseResourceID parses a string to an instance of ResourceID
64+func ParseResourceID(id string) (*ResourceID, error) {
66+ return nil, fmt.Errorf("invalid resource ID: id cannot be empty")
69+ if !strings.HasPrefix(id, "/") {
70+ return nil, fmt.Errorf("invalid resource ID: resource id '%s' must start with '/'", id)
73+ parts := splitStringAndOmitEmpty(id, "/")
76+ return nil, fmt.Errorf("invalid resource ID: %s", id)
79+ if !strings.EqualFold(parts[0], subscriptionsKey) && !strings.EqualFold(parts[0], providersKey) {
80+ return nil, fmt.Errorf("invalid resource ID: %s", id)
83+ return appendNext(RootResourceID, parts, id)
86+// String returns the string of the ResourceID
87+func (id *ResourceID) String() string {
88+ if len(id.stringValue) > 0 {
89+ return id.stringValue
92+ if id.Parent == nil {
96+ builder := strings.Builder{}
97+ builder.WriteString(id.Parent.String())
100+ builder.WriteString(fmt.Sprintf("/%s", id.ResourceType.lastType()))
101+ if len(id.Name) > 0 {
102+ builder.WriteString(fmt.Sprintf("/%s", id.Name))
105+ builder.WriteString(fmt.Sprintf("/providers/%s/%s/%s", id.ResourceType.Namespace, id.ResourceType.Type, id.Name))
108+ id.stringValue = builder.String()
110+ return id.stringValue
113+// MarshalText returns a textual representation of the ResourceID
114+func (id *ResourceID) MarshalText() ([]byte, error) {
115+ return []byte(id.String()), nil
118+// UnmarshalText decodes the textual representation of a ResourceID
119+func (id *ResourceID) UnmarshalText(text []byte) error {
120+ newId, err := ParseResourceID(string(text))
128+func newResourceID(parent *ResourceID, resourceTypeName string, resourceName string) *ResourceID {
130+ id.init(parent, chooseResourceType(resourceTypeName, parent), resourceName, true)
134+func newResourceIDWithResourceType(parent *ResourceID, resourceType ResourceType, resourceName string) *ResourceID {
136+ id.init(parent, resourceType, resourceName, true)
140+func newResourceIDWithProvider(parent *ResourceID, providerNamespace, resourceTypeName, resourceName string) *ResourceID {
142+ id.init(parent, NewResourceType(providerNamespace, resourceTypeName), resourceName, false)
146+func chooseResourceType(resourceTypeName string, parent *ResourceID) ResourceType {
147+ if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) {
148+ return ResourceGroupResourceType
149+ } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && parent != nil && parent.ResourceType.String() == TenantResourceType.String() {
150+ return SubscriptionResourceType
153+ return parent.ResourceType.AppendChild(resourceTypeName)
156+func (id *ResourceID) init(parent *ResourceID, resourceType ResourceType, name string, isChild bool) {
158+ id.Provider = parent.Provider
159+ id.SubscriptionID = parent.SubscriptionID
160+ id.ResourceGroupName = parent.ResourceGroupName
161+ id.Location = parent.Location
164+ if resourceType.String() == SubscriptionResourceType.String() {
165+ id.SubscriptionID = name
168+ if resourceType.lastType() == locationsKey {
172+ if resourceType.String() == ResourceGroupResourceType.String() {
173+ id.ResourceGroupName = name
176+ if resourceType.String() == ProviderResourceType.String() {
181+ id.Parent = RootResourceID
185+ id.isChild = isChild
186+ id.ResourceType = resourceType
190+func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, error) {
191+ if len(parts) == 0 {
195+ if len(parts) == 1 {
196+ // subscriptions and resourceGroups are not valid ids without their names
197+ if strings.EqualFold(parts[0], subscriptionsKey) || strings.EqualFold(parts[0], resourceGroupsLowerKey) {
198+ return nil, fmt.Errorf("invalid resource ID: %s", id)
201+ // resourceGroup must contain either child or provider resource type
202+ if parent.ResourceType.String() == ResourceGroupResourceType.String() {
203+ return nil, fmt.Errorf("invalid resource ID: %s", id)
206+ return newResourceID(parent, parts[0], ""), nil
209+ if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) {
210+ // provider resource can only be on a tenant or a subscription parent
211+ if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() {
212+ return nil, fmt.Errorf("invalid resource ID: %s", id)
215+ return appendNext(newResourceIDWithResourceType(parent, ProviderResourceType, parts[1]), parts[2:], id)
218+ if len(parts) > 3 && strings.EqualFold(parts[0], providersKey) {
219+ return appendNext(newResourceIDWithProvider(parent, parts[1], parts[2], parts[3]), parts[4:], id)
222+ if len(parts) > 1 && !strings.EqualFold(parts[0], providersKey) {
223+ return appendNext(newResourceID(parent, parts[0], parts[1]), parts[2:], id)
226+ return nil, fmt.Errorf("invalid resource ID: %s", id)
229+func splitStringAndOmitEmpty(v, sep string) []string {
230+ r := make([]string, 0)
231+ for _, s := range strings.Split(v, sep) {
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.gonew file+114
@@ -0,0 +1,114 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+// SubscriptionResourceType is the ResourceType of a subscription
15+var SubscriptionResourceType = NewResourceType(builtInResourceNamespace, "subscriptions")
17+// ResourceGroupResourceType is the ResourceType of a resource group
18+var ResourceGroupResourceType = NewResourceType(builtInResourceNamespace, "resourceGroups")
20+// TenantResourceType is the ResourceType of a tenant
21+var TenantResourceType = NewResourceType(builtInResourceNamespace, "tenants")
23+// ProviderResourceType is the ResourceType of a provider
24+var ProviderResourceType = NewResourceType(builtInResourceNamespace, "providers")
26+// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets".
27+// Don't create this type directly, use ParseResourceType or NewResourceType instead.
28+type ResourceType struct {
29+ // Namespace is the namespace of the resource type.
30+ // e.g. "Microsoft.Network" in resource type "Microsoft.Network/virtualNetworks/subnets"
33+ // Type is the full type name of the resource type.
34+ // e.g. "virtualNetworks/subnets" in resource type "Microsoft.Network/virtualNetworks/subnets"
37+ // Types is the slice of all the sub-types of this resource type.
38+ // e.g. ["virtualNetworks", "subnets"] in resource type "Microsoft.Network/virtualNetworks/subnets"
44+// String returns the string of the ResourceType
45+func (t ResourceType) String() string {
49+// IsParentOf returns true when the receiver is the parent resource type of the child.
50+func (t ResourceType) IsParentOf(child ResourceType) bool {
51+ if !strings.EqualFold(t.Namespace, child.Namespace) {
54+ if len(t.Types) >= len(child.Types) {
57+ for i := range t.Types {
58+ if !strings.EqualFold(t.Types[i], child.Types[i]) {
66+// AppendChild creates an instance of ResourceType using the receiver as the parent with childType appended to it.
67+func (t ResourceType) AppendChild(childType string) ResourceType {
68+ return NewResourceType(t.Namespace, fmt.Sprintf("%s/%s", t.Type, childType))
71+// NewResourceType creates an instance of ResourceType using a provider namespace
72+// such as "Microsoft.Network" and type such as "virtualNetworks/subnets".
73+func NewResourceType(providerNamespace, typeName string) ResourceType {
75+ Namespace: providerNamespace,
77+ Types: splitStringAndOmitEmpty(typeName, "/"),
78+ stringValue: fmt.Sprintf("%s/%s", providerNamespace, typeName),
82+// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets)
83+// or a resource identifier string.
84+// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet)
85+func ParseResourceType(resourceIDOrType string) (ResourceType, error) {
86+ // split the path into segments
87+ parts := splitStringAndOmitEmpty(resourceIDOrType, "/")
89+ // There must be at least a namespace and type name
91+ return ResourceType{}, fmt.Errorf("invalid resource ID or type: %s", resourceIDOrType)
94+ // if the type is just subscriptions, it is a built-in type in the Microsoft.Resources namespace
96+ // Simple resource type
97+ return NewResourceType(builtInResourceNamespace, parts[0]), nil
98+ } else if strings.Contains(parts[0], ".") {
99+ // Handle resource types (Microsoft.Compute/virtualMachines, Microsoft.Network/virtualNetworks/subnets)
100+ // it is a full type name
101+ return NewResourceType(parts[0], strings.Join(parts[1:], "/")), nil
103+ // Check if ResourceID
104+ id, err := ParseResourceID(resourceIDOrType)
106+ return ResourceType{}, err
108+ return NewResourceType(id.ResourceType.Namespace, id.ResourceType.Type), nil
112+func (t ResourceType) lastType() string {
113+ return t.Types[len(t.Types)-1]
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.gonew file+108
@@ -0,0 +1,108 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
12+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
15+// BearerTokenOptions configures the bearer token policy's behavior.
16+type BearerTokenOptions struct {
17+ // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests.
18+ // The policy will add a token from each of these tenants to every request. The
19+ // authenticating user or service principal must be a guest in these tenants, and the
20+ // policy's credential must support multitenant authentication.
21+ AuxiliaryTenants []string
23+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
24+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
25+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
26+ InsecureAllowCredentialWithHTTP bool
28+ // Scopes contains the list of permission scopes required for the token.
32+// RegistrationOptions configures the registration policy's behavior.
33+// All zero-value fields will be initialized with their default values.
34+type RegistrationOptions struct {
37+ // MaxAttempts is the total number of times to attempt automatic registration
38+ // in the event that an attempt fails.
39+ // The default value is 3.
40+ // Set to a value less than zero to disable the policy.
43+ // PollingDelay is the amount of time to sleep between polling intervals.
44+ // The default value is 15 seconds.
45+ // A value less than zero means no delay between polling intervals (not recommended).
46+ PollingDelay time.Duration
48+ // PollingDuration is the amount of time to wait before abandoning polling.
49+ // The default valule is 5 minutes.
50+ // NOTE: Setting this to a small value might cause the policy to prematurely fail.
51+ PollingDuration time.Duration
53+ // StatusCodes contains the slice of custom HTTP status codes to use instead
54+ // of the default http.StatusConflict. This should only be set if a service
55+ // returns a non-standard HTTP status code when unregistered.
59+// ClientOptions contains configuration settings for a client's pipeline.
60+type ClientOptions struct {
63+ // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests.
64+ // The client will add a token from each of these tenants to every request. The
65+ // authenticating user or service principal must be a guest in these tenants, and the
66+ // client's credential must support multitenant authentication.
67+ AuxiliaryTenants []string
69+ // DisableRPRegistration disables the auto-RP registration policy. Defaults to false.
70+ DisableRPRegistration bool
73+// Clone return a deep copy of the current options.
74+func (o *ClientOptions) Clone() *ClientOptions {
79+ copiedOptions.Cloud.Services = copyMap(copiedOptions.Cloud.Services)
80+ copiedOptions.Logging.AllowedHeaders = copyArray(copiedOptions.Logging.AllowedHeaders)
81+ copiedOptions.Logging.AllowedQueryParams = copyArray(copiedOptions.Logging.AllowedQueryParams)
82+ copiedOptions.Retry.StatusCodes = copyArray(copiedOptions.Retry.StatusCodes)
83+ copiedOptions.PerRetryPolicies = copyArray(copiedOptions.PerRetryPolicies)
84+ copiedOptions.PerCallPolicies = copyArray(copiedOptions.PerCallPolicies)
85+ return &copiedOptions
88+// copyMap return a new map with all the key value pair in the src map
89+func copyMap[K comparable, V any](src map[K]V) map[K]V {
93+ copiedMap := make(map[K]V)
94+ for k, v := range src {
100+// copyMap return a new array with all the elements in the src array
101+func copyArray[T any](src []T) []T {
105+ copiedArray := make([]T, len(src))
106+ copy(copiedArray, src)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.gonew file+70
@@ -0,0 +1,70 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
14+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
17+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
18+ azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
21+// NewPipeline creates a pipeline from connection options. Policies from ClientOptions are
22+// placed after policies from PipelineOptions. The telemetry policy, when enabled, will
23+// use the specified module and version info.
24+func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azruntime.PipelineOptions, options *armpolicy.ClientOptions) (azruntime.Pipeline, error) {
26+ options = &armpolicy.ClientOptions{}
28+ conf, err := getConfiguration(&options.ClientOptions)
30+ return azruntime.Pipeline{}, err
32+ authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{
33+ AuxiliaryTenants: options.AuxiliaryTenants,
34+ InsecureAllowCredentialWithHTTP: options.InsecureAllowCredentialWithHTTP,
35+ Scopes: []string{conf.Audience + "/.default"},
37+ // we don't want to modify the underlying array in plOpts.PerRetry
38+ perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1)
39+ copy(perRetry, plOpts.PerRetry)
40+ perRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy))
41+ plOpts.PerRetry = perRetry
42+ if !options.DisableRPRegistration {
43+ regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions}
44+ regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts)
46+ return azruntime.Pipeline{}, err
48+ // we don't want to modify the underlying array in plOpts.PerCall
49+ perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1)
50+ copy(perCall, plOpts.PerCall)
51+ perCall = append(perCall, regPolicy)
52+ plOpts.PerCall = perCall
54+ if plOpts.APIVersion.Name == "" {
55+ plOpts.APIVersion.Name = "api-version"
57+ return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil
60+func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) {
61+ c := cloud.AzurePublic
62+ if !reflect.ValueOf(o.Cloud).IsZero() {
65+ if conf, ok := c.Services[cloud.ResourceManager]; ok && conf.Endpoint != "" && conf.Audience != "" {
68+ return conf, errors.New("provided Cloud field is missing Azure Resource Manager configuration")
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.gonew file+102
@@ -0,0 +1,102 @@
1+// Copyright (c) Microsoft Corporation. All rights reserved.
2+// Licensed under the MIT License.
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
14+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
16+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
17+ azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
18+ "github.com/Azure/azure-sdk-for-go/sdk/internal/temporal"
21+const headerAuxiliaryAuthorization = "x-ms-authorization-auxiliary"
23+// acquiringResourceState holds data for an auxiliary token request
24+type acquiringResourceState struct {
30+// acquireAuxToken acquires a token from an auxiliary tenant. Only one thread/goroutine at a time ever calls this function.
31+func acquireAuxToken(state acquiringResourceState) (newResource azcore.AccessToken, newExpiration time.Time, err error) {
32+ tk, err := state.p.cred.GetToken(state.ctx, azpolicy.TokenRequestOptions{
34+ Scopes: state.p.scopes,
35+ TenantID: state.tenant,
38+ return azcore.AccessToken{}, time.Time{}, err
40+ return tk, tk.ExpiresOn, nil
43+// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential.
44+type BearerTokenPolicy struct {
45+ auxResources map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState]
46+ btp *azruntime.BearerTokenPolicy
47+ cred azcore.TokenCredential
51+// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens.
52+// cred: an azcore.TokenCredential implementation such as a credential object from azidentity
53+// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options.
54+func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTokenOptions) *BearerTokenPolicy {
56+ opts = &armpolicy.BearerTokenOptions{}
58+ p := &BearerTokenPolicy{cred: cred}
59+ p.auxResources = make(map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState], len(opts.AuxiliaryTenants))
60+ for _, t := range opts.AuxiliaryTenants {
61+ p.auxResources[t] = temporal.NewResource(acquireAuxToken)
63+ p.scopes = make([]string, len(opts.Scopes))
64+ copy(p.scopes, opts.Scopes)
65+ p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{
66+ InsecureAllowCredentialWithHTTP: opts.InsecureAllowCredentialWithHTTP,
67+ AuthorizationHandler: azpolicy.AuthorizationHandler{
68+ OnRequest: p.onRequest,
74+// onRequest authorizes requests with one or more bearer tokens
75+func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolicy.TokenRequestOptions) error) error {
76+ // authorize the request with a token for the primary tenant
77+ err := authNZ(azpolicy.TokenRequestOptions{Scopes: b.scopes})
78+ if err != nil || len(b.auxResources) == 0 {
81+ // add tokens for auxiliary tenants
82+ as := acquiringResourceState{
83+ ctx: req.Raw().Context(),
86+ auxTokens := make([]string, 0, len(b.auxResources))
87+ for tenant, er := range b.auxResources {
89+ auxTk, err := er.Get(as)
93+ auxTokens = append(auxTokens, fmt.Sprintf("%s%s", shared.BearerTokenPrefix, auxTk.Token))
95+ req.Raw().Header.Set(headerAuxiliaryAuthorization, strings.Join(auxTokens, ", "))
99+// Do authorizes a request with a bearer token
100+func (b *BearerTokenPolicy) Do(req *azpolicy.Request) (*http.Response, error) {
101+ return b.btp.Do(req)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.gonew file+322
@@ -0,0 +1,322 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
19+ armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy"
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
21+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
22+ azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
23+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
24+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
28+ // LogRPRegistration entries contain information specific to the automatic registration of an RP.
29+ // Entries of this classification are written IFF the policy needs to take any action.
30+ LogRPRegistration log.Event = "RPRegistration"
33+// init sets any default values
34+func setDefaults(r *armpolicy.RegistrationOptions) {
35+ if r.MaxAttempts == 0 {
37+ } else if r.MaxAttempts < 0 {
40+ if r.PollingDelay == 0 {
41+ r.PollingDelay = 15 * time.Second
42+ } else if r.PollingDelay < 0 {
45+ if r.PollingDuration == 0 {
46+ r.PollingDuration = 5 * time.Minute
48+ if len(r.StatusCodes) == 0 {
49+ r.StatusCodes = []int{http.StatusConflict}
53+// NewRPRegistrationPolicy creates a policy object configured using the specified options.
54+// The policy controls whether an unregistered resource provider should automatically be
55+// registered. See https://aka.ms/rps-not-found for more information.
56+func NewRPRegistrationPolicy(cred azcore.TokenCredential, o *armpolicy.RegistrationOptions) (azpolicy.Policy, error) {
58+ o = &armpolicy.RegistrationOptions{}
60+ conf, err := getConfiguration(&o.ClientOptions)
64+ authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{conf.Audience + "/.default"}})
65+ p := &rpRegistrationPolicy{
66+ endpoint: conf.Endpoint,
67+ pipeline: runtime.NewPipeline(shared.Module, shared.Version, runtime.PipelineOptions{PerRetry: []azpolicy.Policy{authPolicy}}, &o.ClientOptions),
71+ setDefaults(&p.options)
75+type rpRegistrationPolicy struct {
77+ pipeline runtime.Pipeline
78+ options armpolicy.RegistrationOptions
81+func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) {
82+ if r.options.MaxAttempts == 0 {
83+ // policy is disabled
86+ const registeredState = "Registered"
88+ var resp *http.Response
89+ for attempts := 0; attempts < r.options.MaxAttempts; attempts++ {
91+ // make the original request
92+ resp, err = req.Next()
93+ // getting a 409 is the first indication that the RP might need to be registered, check error response
94+ if err != nil || !runtime.HasStatusCode(resp, r.options.StatusCodes...) {
97+ var reqErr requestError
98+ if err = runtime.UnmarshalAsJSON(resp, &reqErr); err != nil {
101+ if reqErr.ServiceError == nil {
102+ // missing service error info. just return the response
103+ // to the caller so its error unmarshalling will kick in
106+ if !isUnregisteredRPCode(reqErr.ServiceError.Code) {
107+ // not a 409 due to unregistered RP. just return the response
108+ // to the caller so its error unmarshalling will kick in
111+ res, err := resource.ParseResourceID(req.Raw().URL.Path)
115+ rp = res.ResourceType.Namespace
116+ logRegistrationExit := func(v any) {
117+ log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v)
119+ log.Writef(LogRPRegistration, "BEGIN registration for %s", rp)
120+ // create client and make the registration request
121+ // we use the scheme and host from the original request
122+ rpOps := &providersOperations{
125+ subID: res.SubscriptionID,
127+ if _, err = rpOps.Register(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, rp); err != nil {
128+ logRegistrationExit(err)
132+ // RP was registered, however we need to wait for the registration to complete
133+ pollCtx, pollCancel := context.WithTimeout(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, r.options.PollingDuration)
134+ var lastRegState string
136+ // get the current registration state
137+ getResp, err := rpOps.Get(pollCtx, rp)
140+ logRegistrationExit(err)
143+ if getResp.Provider.RegistrationState != nil && !strings.EqualFold(*getResp.Provider.RegistrationState, lastRegState) {
144+ // registration state has changed, or was updated for the first time
145+ lastRegState = *getResp.Provider.RegistrationState
146+ log.Writef(LogRPRegistration, "registration state is %s", lastRegState)
148+ if strings.EqualFold(lastRegState, registeredState) {
149+ // registration complete
151+ logRegistrationExit(lastRegState)
154+ // wait before trying again
156+ case <-time.After(r.options.PollingDelay):
158+ case <-pollCtx.Done():
160+ logRegistrationExit(pollCtx.Err())
161+ return resp, pollCtx.Err()
164+ // RP was successfully registered, retry the original request
165+ err = req.RewindBody()
170+ // if we get here it means we exceeded the number of attempts
171+ return resp, fmt.Errorf("exceeded attempts to register %s", rp)
174+var unregisteredRPCodes = []string{
175+ "MissingSubscriptionRegistration",
176+ "MissingRegistrationForResourceProvider",
177+ "Subscription Not Registered",
178+ "SubscriptionNotRegistered",
181+func isUnregisteredRPCode(errorCode string) bool {
182+ for _, code := range unregisteredRPCodes {
183+ if strings.EqualFold(errorCode, code) {
190+// minimal error definitions to simplify detection
191+type requestError struct {
192+ ServiceError *serviceError `json:"error"`
195+type serviceError struct {
196+ Code string `json:"code"`
199+///////////////////////////////////////////////////////////////////////////////////////////////
200+// the following code was copied from module armresources, providers.go and models.go
201+// only the minimum amount of code was copied to get this working and some edits were made.
202+///////////////////////////////////////////////////////////////////////////////////////////////
204+type providersOperations struct {
210+// Get - Gets the specified resource provider.
211+func (client *providersOperations) Get(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) {
212+ req, err := client.getCreateRequest(ctx, resourceProviderNamespace)
214+ return providerResponse{}, err
216+ resp, err := client.p.Do(req)
218+ return providerResponse{}, err
220+ result, err := client.getHandleResponse(resp)
222+ return providerResponse{}, err
227+// getCreateRequest creates the Get request.
228+func (client *providersOperations) getCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) {
229+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"
230+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
231+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID))
232+ req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.u, urlPath))
236+ query := req.Raw().URL.Query()
237+ query.Set("api-version", "2019-05-01")
238+ req.Raw().URL.RawQuery = query.Encode()
242+// getHandleResponse handles the Get response.
243+func (client *providersOperations) getHandleResponse(resp *http.Response) (providerResponse, error) {
244+ if !runtime.HasStatusCode(resp, http.StatusOK) {
245+ return providerResponse{}, exported.NewResponseError(resp)
247+ result := providerResponse{RawResponse: resp}
248+ err := runtime.UnmarshalAsJSON(resp, &result.Provider)
250+ return providerResponse{}, err
255+// Register - Registers a subscription with a resource provider.
256+func (client *providersOperations) Register(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) {
257+ req, err := client.registerCreateRequest(ctx, resourceProviderNamespace)
259+ return providerResponse{}, err
261+ resp, err := client.p.Do(req)
263+ return providerResponse{}, err
265+ result, err := client.registerHandleResponse(resp)
267+ return providerResponse{}, err
272+// registerCreateRequest creates the Register request.
273+func (client *providersOperations) registerCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) {
274+ urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"
275+ urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace))
276+ urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID))
277+ req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.u, urlPath))
281+ query := req.Raw().URL.Query()
282+ query.Set("api-version", "2019-05-01")
283+ req.Raw().URL.RawQuery = query.Encode()
287+// registerHandleResponse handles the Register response.
288+func (client *providersOperations) registerHandleResponse(resp *http.Response) (providerResponse, error) {
289+ if !runtime.HasStatusCode(resp, http.StatusOK) {
290+ return providerResponse{}, exported.NewResponseError(resp)
292+ result := providerResponse{RawResponse: resp}
293+ err := runtime.UnmarshalAsJSON(resp, &result.Provider)
295+ return providerResponse{}, err
300+// ProviderResponse is the response envelope for operations that return a Provider type.
301+type providerResponse struct {
302+ // Resource provider information.
305+ // RawResponse contains the underlying HTTP response.
306+ RawResponse *http.Response
309+// Provider - Resource provider information.
310+type provider struct {
312+ ID *string `json:"id,omitempty"`
314+ // The namespace of the resource provider.
315+ Namespace *string `json:"namespace,omitempty"`
317+ // The registration policy of the resource provider.
318+ RegistrationPolicy *string `json:"registrationPolicy,omitempty"`
320+ // The registration state of the resource provider.
321+ RegistrationState *string `json:"registrationState,omitempty"`
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.gonew file+30
@@ -0,0 +1,30 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
12+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource"
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
18+// httpTraceNamespacePolicy is a policy that adds the az.namespace attribute to the current Span
19+func httpTraceNamespacePolicy(req *policy.Request) (resp *http.Response, err error) {
20+ rawTracer := req.Raw().Context().Value(shared.CtxWithTracingTracer{})
21+ if tracer, ok := rawTracer.(tracing.Tracer); ok && tracer.Enabled() {
22+ rt, err := resource.ParseResourceType(req.Raw().URL.Path)
24+ // add the namespace attribute to the current span
25+ span := tracer.SpanFromContext(req.Raw().Context())
26+ span.SetAttributes(tracing.Attribute{Key: shared.TracingNamespaceAttrName, Value: rt.Namespace})
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.gonew file+24
@@ -0,0 +1,24 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
9+import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
12+ cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
13+ Audience: "https://management.core.chinacloudapi.cn",
14+ Endpoint: "https://management.chinacloudapi.cn",
16+ cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
17+ Audience: "https://management.core.usgovcloudapi.net",
18+ Endpoint: "https://management.usgovcloudapi.net",
20+ cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{
21+ Audience: "https://management.core.windows.net/",
22+ Endpoint: "https://management.azure.com",
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/ci.ymlnew file+29
@@ -0,0 +1,29 @@
1+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
27+ template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
29+ ServiceDirectory: azcore
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/cloud.gonew file+44
@@ -0,0 +1,44 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
10+ // AzureChina contains configuration for Azure China.
11+ AzureChina = Configuration{
12+ ActiveDirectoryAuthorityHost: "https://login.chinacloudapi.cn/", Services: map[ServiceName]ServiceConfiguration{},
14+ // AzureGovernment contains configuration for Azure Government.
15+ AzureGovernment = Configuration{
16+ ActiveDirectoryAuthorityHost: "https://login.microsoftonline.us/", Services: map[ServiceName]ServiceConfiguration{},
18+ // AzurePublic contains configuration for Azure Public Cloud.
19+ AzurePublic = Configuration{
20+ ActiveDirectoryAuthorityHost: "https://login.microsoftonline.com/", Services: map[ServiceName]ServiceConfiguration{},
24+// ServiceName identifies a cloud service.
25+type ServiceName string
27+// ResourceManager is a global constant identifying Azure Resource Manager.
28+const ResourceManager ServiceName = "resourceManager"
30+// ServiceConfiguration configures a specific cloud service such as Azure Resource Manager.
31+type ServiceConfiguration struct {
32+ // Audience is the audience the client will request for its access tokens.
34+ // Endpoint is the service's base URL.
38+// Configuration configures a cloud.
39+type Configuration struct {
40+ // ActiveDirectoryAuthorityHost is the base URL of the cloud's Azure Active Directory.
41+ ActiveDirectoryAuthorityHost string
42+ // Services contains configuration for the cloud's services.
43+ Services map[ServiceName]ServiceConfiguration
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud/doc.gonew file+53
@@ -0,0 +1,53 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
8+Package cloud implements a configuration API for applications deployed to sovereign or private Azure clouds.
10+Azure SDK client configuration defaults are appropriate for Azure Public Cloud (sometimes referred to as
11+"Azure Commercial" or simply "Microsoft Azure"). This package enables applications deployed to other
12+Azure Clouds to configure clients appropriately.
14+This package contains predefined configuration for well-known sovereign clouds such as Azure Government and
15+Azure China. Azure SDK clients accept this configuration via the Cloud field of azcore.ClientOptions. For
16+example, configuring a credential and ARM client for Azure Government:
18+ opts := azcore.ClientOptions{Cloud: cloud.AzureGovernment}
19+ cred, err := azidentity.NewDefaultAzureCredential(
20+ &azidentity.DefaultAzureCredentialOptions{ClientOptions: opts},
24+ client, err := armsubscription.NewClient(
25+ cred, &arm.ClientOptions{ClientOptions: opts},
29+Applications deployed to a private cloud such as Azure Stack create a Configuration object with
32+ c := cloud.Configuration{
33+ ActiveDirectoryAuthorityHost: "https://...",
34+ Services: map[cloud.ServiceName]cloud.ServiceConfiguration{
35+ cloud.ResourceManager: {
37+ Endpoint: "https://...",
41+ opts := azcore.ClientOptions{Cloud: c}
43+ cred, err := azidentity.NewDefaultAzureCredential(
44+ &azidentity.DefaultAzureCredentialOptions{ClientOptions: opts},
48+ client, err := armsubscription.NewClient(
49+ cred, &arm.ClientOptions{ClientOptions: opts},
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/core.gonew file+173
@@ -0,0 +1,173 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
20+// AccessToken represents an Azure service bearer access token with expiry information.
21+type AccessToken = exported.AccessToken
23+// TokenCredential represents a credential capable of providing an OAuth token.
24+type TokenCredential = exported.TokenCredential
26+// KeyCredential contains an authentication key used to authenticate to an Azure service.
27+type KeyCredential = exported.KeyCredential
29+// NewKeyCredential creates a new instance of [KeyCredential] with the specified values.
30+// - key is the authentication key
31+func NewKeyCredential(key string) *KeyCredential {
32+ return exported.NewKeyCredential(key)
35+// SASCredential contains a shared access signature used to authenticate to an Azure service.
36+type SASCredential = exported.SASCredential
38+// NewSASCredential creates a new instance of [SASCredential] with the specified values.
39+// - sas is the shared access signature
40+func NewSASCredential(sas string) *SASCredential {
41+ return exported.NewSASCredential(sas)
44+// holds sentinel values used to send nulls
45+var nullables map[reflect.Type]any = map[reflect.Type]any{}
46+var nullablesMu sync.RWMutex
48+// NullValue is used to send an explicit 'null' within a request.
49+// This is typically used in JSON-MERGE-PATCH operations to delete a value.
50+func NullValue[T any]() T {
51+ t := shared.TypeOfT[T]()
54+ v, found := nullables[t]
55+ nullablesMu.RUnlock()
58+ // return the sentinel object
62+ // promote to exclusive lock and check again (double-checked locking pattern)
64+ defer nullablesMu.Unlock()
65+ v, found = nullables[t]
69+ if k := t.Kind(); k == reflect.Map {
70+ o = reflect.MakeMap(t)
71+ } else if k == reflect.Slice {
72+ // empty slices appear to all point to the same data block
73+ // which causes comparisons to become ambiguous. so we create
74+ // a slice with len/cap of one which ensures a unique address.
75+ o = reflect.MakeSlice(t, 1, 1)
77+ o = reflect.New(t.Elem())
82+ // return the sentinel object
86+// IsNullValue returns true if the field contains a null sentinel value.
87+// This is used by custom marshallers to properly encode a null value.
88+func IsNullValue[T any](v T) bool {
89+ // see if our map has a sentinel object for this *T
90+ t := reflect.TypeOf(v)
92+ defer nullablesMu.RUnlock()
94+ if o, found := nullables[t]; found {
95+ o1 := reflect.ValueOf(o)
96+ v1 := reflect.ValueOf(v)
97+ // we found it; return true if v points to the sentinel object.
98+ // NOTE: maps and slices can only be compared to nil, else you get
99+ // a runtime panic. so we compare addresses instead.
100+ return o1.Pointer() == v1.Pointer()
102+ // no sentinel object for this *t
106+// ClientOptions contains optional settings for a client's pipeline.
107+// Instances can be shared across calls to SDK client constructors when uniform configuration is desired.
108+// Zero-value fields will have their specified default values applied during use.
109+type ClientOptions = policy.ClientOptions
111+// Client is a basic HTTP client. It consists of a pipeline and tracing provider.
116+ // cached on the client to support shallow copying with new values
122+// NewClient creates a new Client instance with the provided values.
123+// - moduleName - the fully qualified name of the module where the client is defined; used by the telemetry policy and tracing provider.
124+// - moduleVersion - the semantic version of the module; used by the telemetry policy and tracing provider.
125+// - plOpts - pipeline configuration options; can be the zero-value
126+// - options - optional client configurations; pass nil to accept the default values
127+func NewClient(moduleName, moduleVersion string, plOpts runtime.PipelineOptions, options *ClientOptions) (*Client, error) {
129+ options = &ClientOptions{}
132+ if !options.Telemetry.Disabled {
133+ if err := shared.ValidateModVer(moduleVersion); err != nil {
138+ pl := runtime.NewPipeline(moduleName, moduleVersion, plOpts, options)
140+ tr := options.TracingProvider.NewTracer(moduleName, moduleVersion)
141+ if tr.Enabled() && plOpts.Tracing.Namespace != "" {
142+ tr.SetAttributes(tracing.Attribute{Key: shared.TracingNamespaceAttrName, Value: plOpts.Tracing.Namespace})
148+ tp: options.TracingProvider,
149+ modVer: moduleVersion,
150+ namespace: plOpts.Tracing.Namespace,
154+// Pipeline returns the pipeline for this client.
155+func (c *Client) Pipeline() runtime.Pipeline {
159+// Tracer returns the tracer for this client.
160+func (c *Client) Tracer() tracing.Tracer {
164+// WithClientName returns a shallow copy of the Client with its tracing client name changed to clientName.
165+// Note that the values for module name and version will be preserved from the source Client.
166+// - clientName - the fully qualified name of the client ("package.Client"); this is used by the tracing provider when creating spans
167+func (c *Client) WithClientName(clientName string) *Client {
168+ tr := c.tp.NewTracer(clientName, c.modVer)
169+ if tr.Enabled() && c.namespace != "" {
170+ tr.SetAttributes(tracing.Attribute{Key: shared.TracingNamespaceAttrName, Value: c.namespace})
172+ return &Client{pl: c.pl, tr: tr, tp: c.tp, modVer: c.modVer, namespace: c.namespace}
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/doc.gonew file+264
@@ -0,0 +1,264 @@
4+// Copyright 2017 Microsoft Corporation. All rights reserved.
5+// Use of this source code is governed by an MIT
6+// license that can be found in the LICENSE file.
9+Package azcore implements an HTTP request/response middleware pipeline used by Azure SDK clients.
11+The middleware consists of three components.
13+ - One or more Policy instances.
14+ - A Transporter instance.
15+ - A Pipeline instance that combines the Policy and Transporter instances.
17+# Implementing the Policy Interface
19+A Policy can be implemented in two ways; as a first-class function for a stateless Policy, or as
20+a method on a type for a stateful Policy. Note that HTTP requests made via the same pipeline share
21+the same Policy instances, so if a Policy mutates its state it MUST be properly synchronized to
22+avoid race conditions.
24+A Policy's Do method is called when an HTTP request wants to be sent over the network. The Do method can
25+perform any operation(s) it desires. For example, it can log the outgoing request, mutate the URL, headers,
26+and/or query parameters, inject a failure, etc. Once the Policy has successfully completed its request
27+work, it must call the Next() method on the *policy.Request instance in order to pass the request to the
28+next Policy in the chain.
30+When an HTTP response comes back, the Policy then gets a chance to process the response/error. The Policy instance
31+can log the response, retry the operation if it failed due to a transient error or timeout, unmarshal the response
32+body, etc. Once the Policy has successfully completed its response work, it must return the *http.Response
33+and error instances to its caller.
35+Template for implementing a stateless Policy:
37+ type policyFunc func(*policy.Request) (*http.Response, error)
39+ // Do implements the Policy interface on policyFunc.
40+ func (pf policyFunc) Do(req *policy.Request) (*http.Response, error) {
44+ func NewMyStatelessPolicy() policy.Policy {
45+ return policyFunc(func(req *policy.Request) (*http.Response, error) {
46+ // TODO: mutate/process Request here
48+ // forward Request to next Policy & get Response/error
49+ resp, err := req.Next()
51+ // TODO: mutate/process Response/error here
53+ // return Response/error to previous Policy
58+Template for implementing a stateful Policy:
60+ type MyStatefulPolicy struct {
61+ // TODO: add configuration/setting fields here
64+ // TODO: add initialization args to NewMyStatefulPolicy()
65+ func NewMyStatefulPolicy() policy.Policy {
66+ return &MyStatefulPolicy{
67+ // TODO: initialize configuration/setting fields here
71+ func (p *MyStatefulPolicy) Do(req *policy.Request) (resp *http.Response, err error) {
72+ // TODO: mutate/process Request here
74+ // forward Request to next Policy & get Response/error
75+ resp, err := req.Next()
77+ // TODO: mutate/process Response/error here
79+ // return Response/error to previous Policy
83+# Implementing the Transporter Interface
85+The Transporter interface is responsible for sending the HTTP request and returning the corresponding
86+HTTP response or error. The Transporter is invoked by the last Policy in the chain. The default Transporter
87+implementation uses a shared http.Client from the standard library.
89+The same stateful/stateless rules for Policy implementations apply to Transporter implementations.
91+# Using Policy and Transporter Instances Via a Pipeline
93+To use the Policy and Transporter instances, an application passes them to the runtime.NewPipeline function.
95+ func NewPipeline(transport Transporter, policies ...Policy) Pipeline
97+The specified Policy instances form a chain and are invoked in the order provided to NewPipeline
98+followed by the Transporter.
100+Once the Pipeline has been created, create a runtime.Request instance and pass it to Pipeline's Do method.
102+ func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Request, error)
104+ func (p Pipeline) Do(req *Request) (*http.Request, error)
106+The Pipeline.Do method sends the specified Request through the chain of Policy and Transporter
107+instances. The response/error is then sent through the same chain of Policy instances in reverse
108+order. For example, assuming there are Policy types PolicyA, PolicyB, and PolicyC along with
111+ pipeline := NewPipeline(TransportA, PolicyA, PolicyB, PolicyC)
113+The flow of Request and Response looks like the following:
115+ policy.Request -> PolicyA -> PolicyB -> PolicyC -> TransportA -----+
119+ caller <--------- PolicyA <- PolicyB <- PolicyC <- http.Response-+
121+# Creating a Request Instance
123+The Request instance passed to Pipeline's Do method is a wrapper around an *http.Request. It also
124+contains some internal state and provides various convenience methods. You create a Request instance
125+by calling the runtime.NewRequest function:
127+ func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Request, error)
129+If the Request should contain a body, call the SetBody method.
131+ func (req *Request) SetBody(body ReadSeekCloser, contentType string) error
133+A seekable stream is required so that upon retry, the retry Policy instance can seek the stream
134+back to the beginning before retrying the network request and re-uploading the body.
136+# Sending an Explicit Null
138+Operations like JSON-MERGE-PATCH send a JSON null to indicate a value should be deleted.
144+This requirement conflicts with the SDK's default marshalling that specifies "omitempty" as
145+a means to resolve the ambiguity between a field to be excluded and its zero-value.
147+ type Widget struct {
148+ Name *string `json:",omitempty"`
149+ Count *int `json:",omitempty"`
152+In the above example, Name and Count are defined as pointer-to-type to disambiguate between
153+a missing value (nil) and a zero-value (0) which might have semantic differences.
155+In a PATCH operation, any fields left as nil are to have their values preserved. When updating
156+a Widget's count, one simply specifies the new value for Count, leaving Name nil.
158+To fulfill the requirement for sending a JSON null, the NullValue() function can be used.
161+ Count: azcore.NullValue[*int](),
164+This sends an explict "null" for Count, indicating that any current value for Count should be deleted.
166+# Processing the Response
168+When the HTTP response is received, the *http.Response is returned directly. Each Policy instance
169+can inspect/mutate the *http.Response.
173+To enable logging, set environment variable AZURE_SDK_GO_LOGGING to "all" before executing your program.
175+By default the logger writes to stderr. This can be customized by calling log.SetListener, providing
176+a callback that writes to the desired location. Any custom logging implementation MUST provide its
177+own synchronization to handle concurrent invocations.
179+See the docs for the log package for further details.
181+# Pageable Operations
183+Pageable operations return potentially large data sets spread over multiple GET requests. The result of
184+each GET is a "page" of data consisting of a slice of items.
186+Pageable operations can be identified by their New*Pager naming convention and return type of *runtime.Pager[T].
188+ func (c *WidgetClient) NewListWidgetsPager(o *Options) *runtime.Pager[PageResponse]
190+The call to WidgetClient.NewListWidgetsPager() returns an instance of *runtime.Pager[T] for fetching pages
191+and determining if there are more pages to fetch. No IO calls are made until the NextPage() method is invoked.
193+ pager := widgetClient.NewListWidgetsPager(nil)
195+ page, err := pager.NextPage(context.TODO())
197+ for _, widget := range page.Values {
202+# Long-Running Operations
204+Long-running operations (LROs) are operations consisting of an initial request to start the operation followed
205+by polling to determine when the operation has reached a terminal state. An LRO's terminal state is one
206+of the following values.
208+ - Succeeded - the LRO completed successfully
209+ - Failed - the LRO failed to complete
210+ - Canceled - the LRO was canceled
212+LROs can be identified by their Begin* prefix and their return type of *runtime.Poller[T].
214+ func (c *WidgetClient) BeginCreateOrUpdate(ctx context.Context, w Widget, o *Options) (*runtime.Poller[Response], error)
216+When a call to WidgetClient.BeginCreateOrUpdate() returns a nil error, it means that the LRO has started.
217+It does _not_ mean that the widget has been created or updated (or failed to be created/updated).
219+The *runtime.Poller[T] provides APIs for determining the state of the LRO. To wait for the LRO to complete,
220+call the PollUntilDone() method.
222+ poller, err := widgetClient.BeginCreateOrUpdate(context.TODO(), Widget{}, nil)
224+ result, err := poller.PollUntilDone(context.TODO(), nil)
228+The call to PollUntilDone() will block the current goroutine until the LRO has reached a terminal state or the
229+context is canceled/timed out.
231+Note that LROs can take anywhere from several seconds to several minutes. The duration is operation-dependent. Due to
232+this variant behavior, pollers do _not_ have a preconfigured time-out. Use a context with the appropriate cancellation
233+mechanism as required.
237+Pollers provide the ability to serialize their state into a "resume token" which can be used by another process to
238+recreate the poller. This is achieved via the runtime.Poller[T].ResumeToken() method.
240+ token, err := poller.ResumeToken()
243+Note that a token can only be obtained for a poller that's in a non-terminal state. Also note that any subsequent calls
244+to poller.Poll() might change the poller's state. In this case, a new token should be created.
246+After the token has been obtained, it can be used to recreate an instance of the originating poller.
248+ poller, err := widgetClient.BeginCreateOrUpdate(nil, Widget{}, &Options{
252+When resuming a poller, no IO is performed, and zero-value arguments can be used for everything but the Options.ResumeToken.
254+Resume tokens are unique per service client and operation. Attempting to resume a poller for LRO BeginB() with a token from LRO
255+BeginA() will result in an error.
259+The fake package contains types used for constructing in-memory fake servers used in unit tests.
260+This allows writing tests to cover various success/error conditions without the need for connecting to a live service.
262+Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/errors.gonew file+17
@@ -0,0 +1,17 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
9+import "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
11+// ResponseError is returned when a request is made to a service and
12+// the service returns a non-success HTTP status code.
13+// Use errors.As() to access this type in the error chain.
15+// When marshaling instances, the RawResponse field will be omitted.
16+// However, the contents returned by Error() will be preserved.
17+type ResponseError = exported.ResponseError
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/etag.gonew file+57
@@ -0,0 +1,57 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
13+// ETag is a property used for optimistic concurrency during updates
14+// ETag is a validator based on https://tools.ietf.org/html/rfc7232#section-2.3.2
15+// An ETag can be empty ("").
18+// ETagAny is an ETag that represents everything, the value is "*"
19+const ETagAny ETag = "*"
21+// Equals does a strong comparison of two ETags. Equals returns true when both
22+// ETags are not weak and the values of the underlying strings are equal.
23+func (e ETag) Equals(other ETag) bool {
24+ return !e.IsWeak() && !other.IsWeak() && e == other
27+// WeakEquals does a weak comparison of two ETags. Two ETags are equivalent if their opaque-tags match
28+// character-by-character, regardless of either or both being tagged as "weak".
29+func (e ETag) WeakEquals(other ETag) bool {
30+ getStart := func(e1 ETag) int {
36+ aStart := getStart(e)
37+ bStart := getStart(other)
40+ bVal := other[bStart:]
45+// IsWeak specifies whether the ETag is strong or weak.
46+func (e ETag) IsWeak() bool {
47+ return len(e) >= 4 && strings.HasPrefix(string(e), "W/\"") && strings.HasSuffix(string(e), "\"")
50+// MatchConditions specifies HTTP options for conditional requests.
51+type MatchConditions struct {
52+ // Optionally limit requests to resources that have a matching ETag.
55+ // Optionally limit requests to resources that do not match the ETag.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.gonew file+175
@@ -0,0 +1,175 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
19+type nopCloser struct {
23+func (n nopCloser) Close() error {
27+// NopCloser returns a ReadSeekCloser with a no-op close method wrapping the provided io.ReadSeeker.
28+// Exported as streaming.NopCloser().
29+func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser {
33+// HasStatusCode returns true if the Response's status code is one of the specified values.
34+// Exported as runtime.HasStatusCode().
35+func HasStatusCode(resp *http.Response, statusCodes ...int) bool {
39+ for _, sc := range statusCodes {
40+ if resp.StatusCode == sc {
47+// AccessToken represents an Azure service bearer access token with expiry information.
48+// Exported as azcore.AccessToken.
49+type AccessToken struct {
54+// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token.
55+// Exported as policy.TokenRequestOptions.
56+type TokenRequestOptions struct {
57+ // Claims are any additional claims required for the token to satisfy a conditional access policy, such as a
58+ // service may return in a claims challenge following an authorization failure. If a service returned the
59+ // claims value base64 encoded, it must be decoded before setting this field.
62+ // EnableCAE indicates whether to enable Continuous Access Evaluation (CAE) for the requested token. When true,
63+ // azidentity credentials request CAE tokens for resource APIs supporting CAE. Clients are responsible for
64+ // handling CAE challenges. If a client that doesn't handle CAE challenges receives a CAE token, it may end up
65+ // in a loop retrying an API call with a token that has been revoked due to CAE.
68+ // Scopes contains the list of permission scopes required for the token.
71+ // TenantID identifies the tenant from which to request the token. azidentity credentials authenticate in
72+ // their configured default tenants when this field isn't set.
76+// TokenCredential represents a credential capable of providing an OAuth token.
77+// Exported as azcore.TokenCredential.
78+type TokenCredential interface {
79+ // GetToken requests an access token for the specified set of scopes.
80+ GetToken(ctx context.Context, options TokenRequestOptions) (AccessToken, error)
83+// DecodeByteArray will base-64 decode the provided string into v.
84+// Exported as runtime.DecodeByteArray()
85+func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error {
90+ if payload[0] == '"' {
91+ // remove surrounding quotes
92+ payload = payload[1 : len(payload)-1]
95+ case Base64StdFormat:
96+ decoded, err := base64.StdEncoding.DecodeString(payload)
102+ case Base64URLFormat:
103+ // use raw encoding as URL format should not contain any '=' characters
104+ decoded, err := base64.RawURLEncoding.DecodeString(payload)
111+ return fmt.Errorf("unrecognized byte array format: %d", format)
115+// KeyCredential contains an authentication key used to authenticate to an Azure service.
116+// Exported as azcore.KeyCredential.
117+type KeyCredential struct {
121+// NewKeyCredential creates a new instance of [KeyCredential] with the specified values.
122+// - key is the authentication key
123+func NewKeyCredential(key string) *KeyCredential {
124+ return &KeyCredential{cred: newKeyCredential(key)}
127+// Update replaces the existing key with the specified value.
128+func (k *KeyCredential) Update(key string) {
132+// SASCredential contains a shared access signature used to authenticate to an Azure service.
133+// Exported as azcore.SASCredential.
134+type SASCredential struct {
138+// NewSASCredential creates a new instance of [SASCredential] with the specified values.
139+// - sas is the shared access signature
140+func NewSASCredential(sas string) *SASCredential {
141+ return &SASCredential{cred: newKeyCredential(sas)}
144+// Update replaces the existing shared access signature with the specified value.
145+func (k *SASCredential) Update(sas string) {
149+// KeyCredentialGet returns the key for cred.
150+func KeyCredentialGet(cred *KeyCredential) string {
151+ return cred.cred.Get()
154+// SASCredentialGet returns the shared access sig for cred.
155+func SASCredentialGet(cred *SASCredential) string {
156+ return cred.cred.Get()
159+type keyCredential struct {
160+ key atomic.Value // string
163+func newKeyCredential(key string) *keyCredential {
164+ keyCred := keyCredential{}
165+ keyCred.key.Store(key)
169+func (k *keyCredential) Get() string {
170+ return k.key.Load().(string)
173+func (k *keyCredential) Update(key string) {
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/pipeline.gonew file+77
@@ -0,0 +1,77 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+// Policy represents an extensibility point for the Pipeline that can mutate the specified
15+// Request and react to the received Response.
16+// Exported as policy.Policy.
17+type Policy interface {
18+ // Do applies the policy to the specified Request. When implementing a Policy, mutate the
19+ // request before calling req.Next() to move on to the next policy, and respond to the result
20+ // before returning to the caller.
21+ Do(req *Request) (*http.Response, error)
24+// Pipeline represents a primitive for sending HTTP requests and receiving responses.
25+// Its behavior can be extended by specifying policies during construction.
26+// Exported as runtime.Pipeline.
27+type Pipeline struct {
31+// Transporter represents an HTTP pipeline transport used to send HTTP requests and receive responses.
32+// Exported as policy.Transporter.
33+type Transporter interface {
34+ // Do sends the HTTP request and returns the HTTP response or error.
35+ Do(req *http.Request) (*http.Response, error)
38+// used to adapt a TransportPolicy to a Policy
39+type transportPolicy struct {
43+func (tp transportPolicy) Do(req *Request) (*http.Response, error) {
45+ return nil, errors.New("missing transporter")
47+ resp, err := tp.trans.Do(req.Raw())
50+ } else if resp == nil {
51+ // there was no response and no error (rare but can happen)
52+ // this ensures the retry policy will retry the request
53+ return nil, errors.New("received nil response")
58+// NewPipeline creates a new Pipeline object from the specified Policies.
59+// Not directly exported, but used as part of runtime.NewPipeline().
60+func NewPipeline(transport Transporter, policies ...Policy) Pipeline {
61+ // transport policy must always be the last in the slice
62+ policies = append(policies, transportPolicy{trans: transport})
68+// Do is called for each and every HTTP request. It passes the request through all
69+// the Policy objects (which can transform the Request's URL/query parameters/headers)
70+// and ultimately sends the transformed HTTP request over the network.
71+func (p Pipeline) Do(req *Request) (*http.Response, error) {
73+ return nil, errors.New("request cannot be nil")
75+ req.policies = p.policies
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/request.gonew file+260
@@ -0,0 +1,260 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
23+// Base64Encoding is usesd to specify which base-64 encoder/decoder to use when
24+// encoding/decoding a slice of bytes to/from a string.
25+// Exported as runtime.Base64Encoding
26+type Base64Encoding int
29+ // Base64StdFormat uses base64.StdEncoding for encoding and decoding payloads.
30+ Base64StdFormat Base64Encoding = 0
32+ // Base64URLFormat uses base64.RawURLEncoding for encoding and decoding payloads.
33+ Base64URLFormat Base64Encoding = 1
36+// EncodeByteArray will base-64 encode the byte slice v.
37+// Exported as runtime.EncodeByteArray()
38+func EncodeByteArray(v []byte, format Base64Encoding) string {
39+ if format == Base64URLFormat {
40+ return base64.RawURLEncoding.EncodeToString(v)
42+ return base64.StdEncoding.EncodeToString(v)
45+// Request is an abstraction over the creation of an HTTP request as it passes through the pipeline.
46+// Don't use this type directly, use NewRequest() instead.
47+// Exported as policy.Request.
50+ body io.ReadSeekCloser
55+type opValues map[reflect.Type]any
57+// Set adds/changes a value
58+func (ov opValues) set(value any) {
59+ ov[reflect.TypeOf(value)] = value
62+// Get looks for a value set by SetValue first
63+func (ov opValues) get(value any) bool {
64+ v, ok := ov[reflect.ValueOf(value).Elem().Type()]
66+ reflect.ValueOf(value).Elem().Set(reflect.ValueOf(v))
71+// NewRequestFromRequest creates a new policy.Request with an existing *http.Request
72+// Exported as runtime.NewRequestFromRequest().
73+func NewRequestFromRequest(req *http.Request) (*Request, error) {
74+ policyReq := &Request{req: req}
77+ // we can avoid a body copy here if the underlying stream is already a
79+ readSeekCloser, isReadSeekCloser := req.Body.(io.ReadSeekCloser)
81+ if !isReadSeekCloser {
82+ // since this is an already populated http.Request we want to copy
83+ // over its body, if it has one.
84+ bodyBytes, err := io.ReadAll(req.Body)
90+ if err := req.Body.Close(); err != nil {
94+ readSeekCloser = NopCloser(bytes.NewReader(bodyBytes))
97+ // SetBody also takes care of updating the http.Request's body
98+ // as well, so they should stay in-sync from this point.
99+ if err := policyReq.SetBody(readSeekCloser, req.Header.Get("Content-Type")); err != nil {
104+ return policyReq, nil
107+// NewRequest creates a new Request with the specified input.
108+// Exported as runtime.NewRequest().
109+func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*Request, error) {
110+ req, err := http.NewRequestWithContext(ctx, httpMethod, endpoint, nil)
114+ if req.URL.Host == "" {
115+ return nil, errors.New("no Host in request URL")
117+ if !(req.URL.Scheme == "http" || req.URL.Scheme == "https") {
118+ return nil, fmt.Errorf("unsupported protocol scheme %s", req.URL.Scheme)
120+ return &Request{req: req}, nil
123+// Body returns the original body specified when the Request was created.
124+func (req *Request) Body() io.ReadSeekCloser {
128+// Raw returns the underlying HTTP request.
129+func (req *Request) Raw() *http.Request {
133+// Next calls the next policy in the pipeline.
134+// If there are no more policies, nil and an error are returned.
135+// This method is intended to be called from pipeline policies.
136+// To send a request through a pipeline call Pipeline.Do().
137+func (req *Request) Next() (*http.Response, error) {
138+ if len(req.policies) == 0 {
139+ return nil, errors.New("no more policies")
141+ nextPolicy := req.policies[0]
143+ nextReq.policies = nextReq.policies[1:]
144+ return nextPolicy.Do(&nextReq)
147+// SetOperationValue adds/changes a mutable key/value associated with a single operation.
148+func (req *Request) SetOperationValue(value any) {
149+ if req.values == nil {
150+ req.values = opValues{}
152+ req.values.set(value)
155+// OperationValue looks for a value set by SetOperationValue().
156+func (req *Request) OperationValue(value any) bool {
157+ if req.values == nil {
160+ return req.values.get(value)
163+// SetBody sets the specified ReadSeekCloser as the HTTP request body, and sets Content-Type and Content-Length
164+// accordingly. If the ReadSeekCloser is nil or empty, Content-Length won't be set. If contentType is "",
165+// Content-Type won't be set, and if it was set, will be deleted.
166+// Use streaming.NopCloser to turn an io.ReadSeeker into an io.ReadSeekCloser.
167+func (req *Request) SetBody(body io.ReadSeekCloser, contentType string) error {
168+ // clobber the existing Content-Type to preserve behavior
169+ return SetBody(req, body, contentType, true)
172+// RewindBody seeks the request's Body stream back to the beginning so it can be resent when retrying an operation.
173+func (req *Request) RewindBody() error {
174+ if req.body != nil {
175+ // Reset the stream back to the beginning and restore the body
176+ _, err := req.body.Seek(0, io.SeekStart)
177+ req.req.Body = req.body
183+// Close closes the request body.
184+func (req *Request) Close() error {
185+ if req.body == nil {
188+ return req.body.Close()
191+// Clone returns a deep copy of the request with its context changed to ctx.
192+func (req *Request) Clone(ctx context.Context) *Request {
194+ r2.req = req.req.Clone(ctx)
198+// WithContext returns a shallow copy of the request with its context changed to ctx.
199+func (req *Request) WithContext(ctx context.Context) *Request {
202+ r2.req = r2.req.WithContext(ctx)
206+// not exported but dependent on Request
208+// PolicyFunc is a type that implements the Policy interface.
209+// Use this type when implementing a stateless policy as a first-class function.
210+type PolicyFunc func(*Request) (*http.Response, error)
212+// Do implements the Policy interface on policyFunc.
213+func (pf PolicyFunc) Do(req *Request) (*http.Response, error) {
217+// SetBody sets the specified ReadSeekCloser as the HTTP request body, and sets Content-Type and Content-Length accordingly.
218+// - req is the request to modify
219+// - body is the request body; if nil or empty, Content-Length won't be set
220+// - contentType is the value for the Content-Type header; if empty, Content-Type will be deleted
221+// - clobberContentType when true, will overwrite the existing value of Content-Type with contentType
222+func SetBody(req *Request, body io.ReadSeekCloser, contentType string, clobberContentType bool) error {
226+ size, err = body.Seek(0, io.SeekEnd) // Seek to the end to get the stream's size
232+ // treat an empty stream the same as a nil one: assign req a nil body
234+ // RFC 9110 specifies a client shouldn't set Content-Length on a request containing no content
235+ // (Del is a no-op when the header has no value)
236+ req.req.Header.Del(shared.HeaderContentLength)
238+ _, err = body.Seek(0, io.SeekStart)
242+ req.req.Header.Set(shared.HeaderContentLength, strconv.FormatInt(size, 10))
243+ req.Raw().GetBody = func() (io.ReadCloser, error) {
244+ _, err := body.Seek(0, io.SeekStart) // Seek back to the beginning of the stream
248+ // keep a copy of the body argument. this is to handle cases
249+ // where req.Body is replaced, e.g. httputil.DumpRequest and friends.
252+ req.req.ContentLength = size
253+ if contentType == "" {
254+ // Del is a no-op when the header has no value
255+ req.req.Header.Del(shared.HeaderContentType)
256+ } else if req.req.Header.Get(shared.HeaderContentType) == "" || clobberContentType {
257+ req.req.Header.Set(shared.HeaderContentType, contentType)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/response_error.gonew file+201
@@ -0,0 +1,201 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
18+ "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
21+// NewResponseError creates a new *ResponseError from the provided HTTP response.
22+// Exported as runtime.NewResponseError().
23+func NewResponseError(resp *http.Response) error {
24+ // prefer the error code in the response header
25+ if ec := resp.Header.Get(shared.HeaderXMSErrorCode); ec != "" {
26+ return NewResponseErrorWithErrorCode(resp, ec)
29+ // if we didn't get x-ms-error-code, check in the response body
30+ body, err := exported.Payload(resp, nil)
32+ // since we're not returning the ResponseError in this
33+ // case we also don't want to write it to the log.
39+ if fromJSON := extractErrorCodeJSON(body); fromJSON != "" {
41+ } else if fromXML := extractErrorCodeXML(body); fromXML != "" {
46+ return NewResponseErrorWithErrorCode(resp, errorCode)
49+// NewResponseErrorWithErrorCode creates an *azcore.ResponseError from the provided HTTP response and errorCode.
50+// Exported as runtime.NewResponseErrorWithErrorCode().
51+func NewResponseErrorWithErrorCode(resp *http.Response, errorCode string) error {
52+ respErr := &ResponseError{
53+ ErrorCode: errorCode,
54+ StatusCode: resp.StatusCode,
57+ log.Write(log.EventResponseError, respErr.Error())
61+func extractErrorCodeJSON(body []byte) string {
62+ var rawObj map[string]any
63+ if err := json.Unmarshal(body, &rawObj); err != nil {
68+ // check if this is a wrapped error, i.e. { "error": { ... } }
69+ // if so then unwrap it
70+ if wrapped, ok := rawObj["error"]; ok {
71+ unwrapped, ok := wrapped.(map[string]any)
76+ } else if wrapped, ok := rawObj["odata.error"]; ok {
77+ // check if this a wrapped odata error, i.e. { "odata.error": { ... } }
78+ unwrapped, ok := wrapped.(map[string]any)
85+ // now check for the error code
86+ code, ok := rawObj["code"]
90+ codeStr, ok := code.(string)
97+func extractErrorCodeXML(body []byte) string {
98+ // regular expression is much easier than dealing with the XML parser
99+ rx := regexp.MustCompile(`<(?:\w+:)?[c|C]ode>\s*(\w+)\s*<\/(?:\w+:)?[c|C]ode>`)
100+ res := rx.FindStringSubmatch(string(body))
104+ // first submatch is the entire thing, second one is the captured error code
108+// ResponseError is returned when a request is made to a service and
109+// the service returns a non-success HTTP status code.
110+// Use errors.As() to access this type in the error chain.
111+// Exported as azcore.ResponseError.
112+type ResponseError struct {
113+ // ErrorCode is the error code returned by the resource provider if available.
116+ // StatusCode is the HTTP status code as defined in https://pkg.go.dev/net/http#pkg-constants.
119+ // RawResponse is the underlying HTTP response.
120+ RawResponse *http.Response `json:"-"`
125+// Error implements the error interface for type ResponseError.
126+// Note that the message contents are not contractual and can change over time.
127+func (e *ResponseError) Error() string {
132+ const separator = "--------------------------------------------------------------------------------"
133+ // write the request method and URL with response status code
134+ msg := &bytes.Buffer{}
135+ if e.RawResponse != nil {
136+ if e.RawResponse.Request != nil {
137+ fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path)
139+ fmt.Fprintln(msg, "Request information not available")
141+ fmt.Fprintln(msg, separator)
142+ fmt.Fprintf(msg, "RESPONSE %d: %s\n", e.RawResponse.StatusCode, e.RawResponse.Status)
144+ fmt.Fprintln(msg, "Missing RawResponse")
145+ fmt.Fprintln(msg, separator)
147+ if e.ErrorCode != "" {
148+ fmt.Fprintf(msg, "ERROR CODE: %s\n", e.ErrorCode)
150+ fmt.Fprintln(msg, "ERROR CODE UNAVAILABLE")
152+ if e.RawResponse != nil {
153+ fmt.Fprintln(msg, separator)
154+ body, err := exported.Payload(e.RawResponse, nil)
156+ // this really shouldn't fail at this point as the response
157+ // body is already cached (it was read in NewResponseError)
158+ fmt.Fprintf(msg, "Error reading response body: %v", err)
159+ } else if len(body) > 0 {
160+ if err := json.Indent(msg, body, "", " "); err != nil {
161+ // failed to pretty-print so just dump it verbatim
162+ fmt.Fprint(msg, string(body))
164+ // the standard library doesn't have a pretty-printer for XML
167+ fmt.Fprintln(msg, "Response contained no body")
170+ fmt.Fprintln(msg, separator)
172+ e.errMsg = msg.String()
176+// internal type used for marshaling/unmarshaling
177+type responseError struct {
178+ ErrorCode string `json:"errorCode"`
179+ StatusCode int `json:"statusCode"`
180+ ErrorMessage string `json:"errorMessage"`
183+func (e ResponseError) MarshalJSON() ([]byte, error) {
184+ return json.Marshal(responseError{
185+ ErrorCode: e.ErrorCode,
186+ StatusCode: e.StatusCode,
187+ ErrorMessage: e.Error(),
191+func (e *ResponseError) UnmarshalJSON(data []byte) error {
192+ re := responseError{}
193+ if err := json.Unmarshal(data, &re); err != nil {
197+ e.ErrorCode = re.ErrorCode
198+ e.StatusCode = re.StatusCode
199+ e.errMsg = re.ErrorMessage
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log/log.gonew file+50
@@ -0,0 +1,50 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
7+// This is an internal helper package to combine the complete logging APIs.
11+ azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
12+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
15+type Event = log.Event
18+ EventRequest = azlog.EventRequest
19+ EventResponse = azlog.EventResponse
20+ EventResponseError = azlog.EventResponseError
21+ EventRetryPolicy = azlog.EventRetryPolicy
22+ EventLRO = azlog.EventLRO
25+// Write invokes the underlying listener with the specified event and message.
26+// If the event shouldn't be logged or there is no listener then Write does nothing.
27+func Write(cls log.Event, msg string) {
31+// Writef invokes the underlying listener with the specified event and formatted message.
32+// If the event shouldn't be logged or there is no listener then Writef does nothing.
33+func Writef(cls log.Event, format string, a ...any) {
34+ log.Writef(cls, format, a...)
37+// SetListener will set the Logger to write to the specified listener.
38+func SetListener(lst func(Event, string)) {
42+// Should returns true if the specified log event should be written to the log.
43+// By default all log events will be logged. Call SetEvents() to limit
44+// the log events for logging.
45+// If no listener has been set this will return false.
46+// Calling this method is useful when the message to log is computationally expensive
47+// and you want to avoid the overhead if its log event is not enabled.
48+func Should(cls log.Event) bool {
49+ return log.Should(cls)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async/async.gonew file+159
@@ -0,0 +1,159 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
19+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
22+// see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md
24+// Applicable returns true if the LRO is using Azure-AsyncOperation.
25+func Applicable(resp *http.Response) bool {
26+ return resp.Header.Get(shared.HeaderAzureAsync) != ""
29+// CanResume returns true if the token can rehydrate this poller type.
30+func CanResume(token map[string]any) bool {
31+ _, ok := token["asyncURL"]
35+// Poller is an LRO poller that uses the Azure-AsyncOperation pattern.
36+type Poller[T any] struct {
41+ // The URL from Azure-AsyncOperation header.
42+ AsyncURL string `json:"asyncURL"`
44+ // The URL from Location header.
45+ LocURL string `json:"locURL"`
47+ // The URL from the initial LRO request.
48+ OrigURL string `json:"origURL"`
50+ // The HTTP method from the initial LRO request.
51+ Method string `json:"method"`
53+ // The value of final-state-via from swagger, can be the empty string.
54+ FinalState pollers.FinalStateVia `json:"finalState"`
56+ // The LRO's current state.
57+ CurState string `json:"state"`
60+// New creates a new Poller from the provided initial response and final-state type.
61+// Pass nil for response to create an empty Poller for rehydration.
62+func New[T any](pl exported.Pipeline, resp *http.Response, finalState pollers.FinalStateVia) (*Poller[T], error) {
64+ log.Write(log.EventLRO, "Resuming Azure-AsyncOperation poller.")
65+ return &Poller[T]{pl: pl}, nil
67+ log.Write(log.EventLRO, "Using Azure-AsyncOperation poller.")
68+ asyncURL := resp.Header.Get(shared.HeaderAzureAsync)
70+ return nil, errors.New("response is missing Azure-AsyncOperation header")
72+ if !poller.IsValidURL(asyncURL) {
73+ return nil, fmt.Errorf("invalid polling URL %s", asyncURL)
75+ // check for provisioning state. if the operation is a RELO
76+ // and terminates synchronously this will prevent extra polling.
77+ // it's ok if there's no provisioning state.
78+ state, _ := poller.GetProvisioningState(resp)
80+ state = poller.StatusInProgress
86+ LocURL: resp.Header.Get(shared.HeaderLocation),
87+ OrigURL: resp.Request.URL.String(),
88+ Method: resp.Request.Method,
89+ FinalState: finalState,
95+// Done returns true if the LRO is in a terminal state.
96+func (p *Poller[T]) Done() bool {
97+ return poller.IsTerminalState(p.CurState)
100+// Poll retrieves the current state of the LRO.
101+func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
102+ err := pollers.PollHelper(ctx, p.AsyncURL, p.pl, func(resp *http.Response) (string, error) {
103+ if !poller.StatusCodeValid(resp) {
105+ return "", exported.NewResponseError(resp)
107+ state, err := poller.GetStatus(resp)
110+ } else if state == "" {
111+ return "", errors.New("the response did not contain a status")
115+ return p.CurState, nil
123+func (p *Poller[T]) Result(ctx context.Context, out *T) error {
124+ if p.resp.StatusCode == http.StatusNoContent {
126+ } else if poller.Failed(p.CurState) {
127+ return exported.NewResponseError(p.resp)
129+ var req *exported.Request
131+ if p.Method == http.MethodPatch || p.Method == http.MethodPut {
132+ // for PATCH and PUT, the final GET is on the original resource URL
133+ req, err = exported.NewRequest(ctx, http.MethodGet, p.OrigURL)
134+ } else if p.Method == http.MethodPost {
135+ if p.FinalState == pollers.FinalStateViaAzureAsyncOp {
136+ // no final GET required
137+ } else if p.FinalState == pollers.FinalStateViaOriginalURI {
138+ req, err = exported.NewRequest(ctx, http.MethodGet, p.OrigURL)
139+ } else if p.LocURL != "" {
140+ // ideally FinalState would be set to "location" but it isn't always.
141+ // must check last due to more permissive condition.
142+ req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL)
149+ // if a final GET request has been created, execute it
151+ resp, err := p.pl.Do(req)
158+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body/body.gonew file+135
@@ -0,0 +1,135 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
17+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
20+// Kind is the identifier of this type in a resume token.
23+// Applicable returns true if the LRO is using no headers, just provisioning state.
24+// This is only applicable to PATCH and PUT methods and assumes no polling headers.
25+func Applicable(resp *http.Response) bool {
26+ // we can't check for absense of headers due to some misbehaving services
27+ // like redis that return a Location header but don't actually use that protocol
28+ return resp.Request.Method == http.MethodPatch || resp.Request.Method == http.MethodPut
31+// CanResume returns true if the token can rehydrate this poller type.
32+func CanResume(token map[string]any) bool {
33+ t, ok := token["type"]
44+// Poller is an LRO poller that uses the Body pattern.
45+type Poller[T any] struct {
50+ // The poller's type, used for resume token processing.
51+ Type string `json:"type"`
53+ // The URL for polling.
54+ PollURL string `json:"pollURL"`
56+ // The LRO's current state.
57+ CurState string `json:"state"`
60+// New creates a new Poller from the provided initial response.
61+// Pass nil for response to create an empty Poller for rehydration.
62+func New[T any](pl exported.Pipeline, resp *http.Response) (*Poller[T], error) {
64+ log.Write(log.EventLRO, "Resuming Body poller.")
65+ return &Poller[T]{pl: pl}, nil
67+ log.Write(log.EventLRO, "Using Body poller.")
72+ PollURL: resp.Request.URL.String(),
74+ // default initial state to InProgress. depending on the HTTP
75+ // status code and provisioning state, we might change the value.
76+ curState := poller.StatusInProgress
77+ provState, err := poller.GetProvisioningState(resp)
78+ if err != nil && !errors.Is(err, poller.ErrNoBody) {
81+ if resp.StatusCode == http.StatusCreated && provState != "" {
82+ // absense of provisioning state is ok for a 201, means the operation is in progress
84+ } else if resp.StatusCode == http.StatusOK {
87+ } else if provState == "" {
88+ // for a 200, absense of provisioning state indicates success
89+ curState = poller.StatusSucceeded
91+ } else if resp.StatusCode == http.StatusNoContent {
92+ curState = poller.StatusSucceeded
94+ p.CurState = curState
98+func (p *Poller[T]) Done() bool {
99+ return poller.IsTerminalState(p.CurState)
102+func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
103+ err := pollers.PollHelper(ctx, p.PollURL, p.pl, func(resp *http.Response) (string, error) {
104+ if !poller.StatusCodeValid(resp) {
106+ return "", exported.NewResponseError(resp)
108+ if resp.StatusCode == http.StatusNoContent {
110+ p.CurState = poller.StatusSucceeded
111+ return p.CurState, nil
113+ state, err := poller.GetProvisioningState(resp)
114+ if errors.Is(err, poller.ErrNoBody) {
115+ // a missing response body in non-204 case is an error
117+ } else if state == "" {
118+ // a response body without provisioning state is considered terminal success
119+ state = poller.StatusSucceeded
120+ } else if err != nil {
125+ return p.CurState, nil
133+func (p *Poller[T]) Result(ctx context.Context, out *T) error {
134+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake/fake.gonew file+133
@@ -0,0 +1,133 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
20+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
23+// Applicable returns true if the LRO is a fake.
24+func Applicable(resp *http.Response) bool {
25+ return resp.Header.Get(shared.HeaderFakePollerStatus) != ""
28+// CanResume returns true if the token can rehydrate this poller type.
29+func CanResume(token map[string]any) bool {
30+ _, ok := token["fakeURL"]
34+// Poller is an LRO poller that uses the Core-Fake-Poller pattern.
35+type Poller[T any] struct {
40+ // The API name from CtxAPINameKey
41+ APIName string `json:"apiName"`
43+ // The URL from Core-Fake-Poller header.
44+ FakeURL string `json:"fakeURL"`
46+ // The LRO's current state.
47+ FakeStatus string `json:"status"`
50+// lroStatusURLSuffix is the URL path suffix for a faked LRO.
51+const lroStatusURLSuffix = "/get/fake/status"
53+// New creates a new Poller from the provided initial response.
54+// Pass nil for response to create an empty Poller for rehydration.
55+func New[T any](pl exported.Pipeline, resp *http.Response) (*Poller[T], error) {
57+ log.Write(log.EventLRO, "Resuming Core-Fake-Poller poller.")
58+ return &Poller[T]{pl: pl}, nil
61+ log.Write(log.EventLRO, "Using Core-Fake-Poller poller.")
62+ fakeStatus := resp.Header.Get(shared.HeaderFakePollerStatus)
63+ if fakeStatus == "" {
64+ return nil, errors.New("response is missing Fake-Poller-Status header")
67+ ctxVal := resp.Request.Context().Value(shared.CtxAPINameKey{})
69+ return nil, errors.New("missing value for CtxAPINameKey")
72+ apiName, ok := ctxVal.(string)
74+ return nil, fmt.Errorf("expected string for CtxAPINameKey, the type was %T", ctxVal)
78+ if resp.Request.URL.RawQuery != "" {
79+ qp = "?" + resp.Request.URL.RawQuery
86+ // NOTE: any changes to this path format MUST be reflected in SanitizePollerPath()
87+ FakeURL: fmt.Sprintf("%s://%s%s%s%s", resp.Request.URL.Scheme, resp.Request.URL.Host, resp.Request.URL.Path, lroStatusURLSuffix, qp),
88+ FakeStatus: fakeStatus,
93+// Done returns true if the LRO is in a terminal state.
94+func (p *Poller[T]) Done() bool {
95+ return poller.IsTerminalState(p.FakeStatus)
98+// Poll retrieves the current state of the LRO.
99+func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
100+ ctx = context.WithValue(ctx, shared.CtxAPINameKey{}, p.APIName)
101+ err := pollers.PollHelper(ctx, p.FakeURL, p.pl, func(resp *http.Response) (string, error) {
102+ if !poller.StatusCodeValid(resp) {
104+ return "", exported.NewResponseError(resp)
106+ fakeStatus := resp.Header.Get(shared.HeaderFakePollerStatus)
107+ if fakeStatus == "" {
108+ return "", errors.New("response is missing Fake-Poller-Status header")
111+ p.FakeStatus = fakeStatus
112+ return p.FakeStatus, nil
120+func (p *Poller[T]) Result(ctx context.Context, out *T) error {
121+ if p.resp.StatusCode == http.StatusNoContent {
123+ } else if poller.Failed(p.FakeStatus) {
124+ return exported.NewResponseError(p.resp)
127+ return pollers.ResultHelper(p.resp, poller.Failed(p.FakeStatus), "", out)
130+// SanitizePollerPath removes any fake-appended suffix from a URL's path.
131+func SanitizePollerPath(path string) string {
132+ return strings.TrimSuffix(path, lroStatusURLSuffix)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc/loc.gonew file+123
@@ -0,0 +1,123 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
19+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
22+// Kind is the identifier of this type in a resume token.
25+// Applicable returns true if the LRO is using Location.
26+func Applicable(resp *http.Response) bool {
27+ return resp.Header.Get(shared.HeaderLocation) != ""
30+// CanResume returns true if the token can rehydrate this poller type.
31+func CanResume(token map[string]any) bool {
32+ t, ok := token["type"]
43+// Poller is an LRO poller that uses the Location pattern.
44+type Poller[T any] struct {
48+ Type string `json:"type"`
49+ PollURL string `json:"pollURL"`
50+ CurState string `json:"state"`
53+// New creates a new Poller from the provided initial response.
54+// Pass nil for response to create an empty Poller for rehydration.
55+func New[T any](pl exported.Pipeline, resp *http.Response) (*Poller[T], error) {
57+ log.Write(log.EventLRO, "Resuming Location poller.")
58+ return &Poller[T]{pl: pl}, nil
60+ log.Write(log.EventLRO, "Using Location poller.")
61+ locURL := resp.Header.Get(shared.HeaderLocation)
63+ return nil, errors.New("response is missing Location header")
65+ if !poller.IsValidURL(locURL) {
66+ return nil, fmt.Errorf("invalid polling URL %s", locURL)
68+ // check for provisioning state. if the operation is a RELO
69+ // and terminates synchronously this will prevent extra polling.
70+ // it's ok if there's no provisioning state.
71+ state, _ := poller.GetProvisioningState(resp)
73+ state = poller.StatusInProgress
84+func (p *Poller[T]) Done() bool {
85+ return poller.IsTerminalState(p.CurState)
88+func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
89+ err := pollers.PollHelper(ctx, p.PollURL, p.pl, func(resp *http.Response) (string, error) {
90+ // location polling can return an updated polling URL
91+ if h := resp.Header.Get(shared.HeaderLocation); h != "" {
94+ // if provisioning state is available, use that. this is only
95+ // for some ARM LRO scenarios (e.g. DELETE with a Location header)
96+ // so if it's missing then use HTTP status code.
97+ provState, _ := poller.GetProvisioningState(resp)
100+ p.CurState = provState
101+ } else if resp.StatusCode == http.StatusAccepted {
102+ p.CurState = poller.StatusInProgress
103+ } else if resp.StatusCode > 199 && resp.StatusCode < 300 {
104+ // any 2xx other than a 202 indicates success
105+ p.CurState = poller.StatusSucceeded
106+ } else if pollers.IsNonTerminalHTTPStatusCode(resp) {
107+ // the request timed out or is being throttled.
108+ // DO NOT include this as a terminal failure. preserve
109+ // the existing state and return the response.
111+ p.CurState = poller.StatusFailed
113+ return p.CurState, nil
121+func (p *Poller[T]) Result(ctx context.Context, out *T) error {
122+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), "", out)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op/op.gonew file+148
@@ -0,0 +1,148 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
19+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
22+// Applicable returns true if the LRO is using Operation-Location.
23+func Applicable(resp *http.Response) bool {
24+ return resp.Header.Get(shared.HeaderOperationLocation) != ""
27+// CanResume returns true if the token can rehydrate this poller type.
28+func CanResume(token map[string]any) bool {
29+ _, ok := token["oplocURL"]
33+// Poller is an LRO poller that uses the Operation-Location pattern.
34+type Poller[T any] struct {
38+ OpLocURL string `json:"oplocURL"`
39+ LocURL string `json:"locURL"`
40+ OrigURL string `json:"origURL"`
41+ Method string `json:"method"`
42+ FinalState pollers.FinalStateVia `json:"finalState"`
43+ ResultPath string `json:"resultPath"`
44+ CurState string `json:"state"`
47+// New creates a new Poller from the provided initial response.
48+// Pass nil for response to create an empty Poller for rehydration.
49+func New[T any](pl exported.Pipeline, resp *http.Response, finalState pollers.FinalStateVia, resultPath string) (*Poller[T], error) {
51+ log.Write(log.EventLRO, "Resuming Operation-Location poller.")
52+ return &Poller[T]{pl: pl}, nil
54+ log.Write(log.EventLRO, "Using Operation-Location poller.")
55+ opURL := resp.Header.Get(shared.HeaderOperationLocation)
57+ return nil, errors.New("response is missing Operation-Location header")
59+ if !poller.IsValidURL(opURL) {
60+ return nil, fmt.Errorf("invalid Operation-Location URL %s", opURL)
62+ locURL := resp.Header.Get(shared.HeaderLocation)
63+ // Location header is optional
64+ if locURL != "" && !poller.IsValidURL(locURL) {
65+ return nil, fmt.Errorf("invalid Location URL %s", locURL)
67+ // default initial state to InProgress. if the
68+ // service sent us a status then use that instead.
69+ curState := poller.StatusInProgress
70+ status, err := poller.GetStatus(resp)
71+ if err != nil && !errors.Is(err, poller.ErrNoBody) {
83+ OrigURL: resp.Request.URL.String(),
84+ Method: resp.Request.Method,
85+ FinalState: finalState,
86+ ResultPath: resultPath,
91+func (p *Poller[T]) Done() bool {
92+ return poller.IsTerminalState(p.CurState)
95+func (p *Poller[T]) Poll(ctx context.Context) (*http.Response, error) {
96+ err := pollers.PollHelper(ctx, p.OpLocURL, p.pl, func(resp *http.Response) (string, error) {
97+ if !poller.StatusCodeValid(resp) {
99+ return "", exported.NewResponseError(resp)
101+ state, err := poller.GetStatus(resp)
104+ } else if state == "" {
105+ return "", errors.New("the response did not contain a status")
109+ return p.CurState, nil
117+func (p *Poller[T]) Result(ctx context.Context, out *T) error {
118+ var req *exported.Request
121+ if p.FinalState == pollers.FinalStateViaLocation && p.LocURL != "" {
122+ req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL)
123+ } else if rl, rlErr := poller.GetResourceLocation(p.resp); rlErr != nil && !errors.Is(rlErr, poller.ErrNoBody) {
125+ } else if rl != "" {
126+ req, err = exported.NewRequest(ctx, http.MethodGet, rl)
127+ } else if p.Method == http.MethodPatch || p.Method == http.MethodPut {
128+ req, err = exported.NewRequest(ctx, http.MethodGet, p.OrigURL)
129+ } else if p.Method == http.MethodPost && p.LocURL != "" {
130+ req, err = exported.NewRequest(ctx, http.MethodGet, p.LocURL)
136+ // if a final GET request has been created, execute it
138+ // no JSON path when making a final GET request
140+ resp, err := p.pl.Do(req)
147+ return pollers.ResultHelper(p.resp, poller.Failed(p.CurState), p.ResultPath, out)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/poller.gonew file+24
@@ -0,0 +1,24 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
9+// FinalStateVia is the enumerated type for the possible final-state-via values.
10+type FinalStateVia string
13+ // FinalStateViaAzureAsyncOp indicates the final payload comes from the Azure-AsyncOperation URL.
14+ FinalStateViaAzureAsyncOp FinalStateVia = "azure-async-operation"
16+ // FinalStateViaLocation indicates the final payload comes from the Location URL.
17+ FinalStateViaLocation FinalStateVia = "location"
19+ // FinalStateViaOriginalURI indicates the final payload comes from the original URL.
20+ FinalStateViaOriginalURI FinalStateVia = "original-uri"
22+ // FinalStateViaOpLocation indicates the final payload comes from the Operation-Location URL.
23+ FinalStateViaOpLocation FinalStateVia = "operation-location"
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/util.gonew file+212
@@ -0,0 +1,212 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ azexported "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
20+ "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
21+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
24+// getTokenTypeName creates a type name from the type parameter T.
25+func getTokenTypeName[T any]() (string, error) {
26+ tt := shared.TypeOfT[T]()
28+ if tt.Kind() == reflect.Pointer {
34+ return "", errors.New("nameless types are not allowed")
39+type resumeTokenWrapper[T any] struct {
40+ Type string `json:"type"`
41+ Token T `json:"token"`
44+// NewResumeToken creates a resume token from the specified type.
45+// An error is returned if the generic type has no name (e.g. struct{}).
46+func NewResumeToken[TResult, TSource any](from TSource) (string, error) {
47+ n, err := getTokenTypeName[TResult]()
51+ b, err := json.Marshal(resumeTokenWrapper[TSource]{
58+ return string(b), nil
61+// ExtractToken returns the poller-specific token information from the provided token value.
62+func ExtractToken(token string) ([]byte, error) {
63+ raw := map[string]json.RawMessage{}
64+ if err := json.Unmarshal([]byte(token), &raw); err != nil {
67+ // this is dependent on the type resumeTokenWrapper[T]
68+ tk, ok := raw["token"]
70+ return nil, errors.New("missing token value")
75+// IsTokenValid returns an error if the specified token isn't applicable for generic type T.
76+func IsTokenValid[T any](token string) error {
77+ raw := map[string]any{}
78+ if err := json.Unmarshal([]byte(token), &raw); err != nil {
83+ return errors.New("missing type value")
87+ return fmt.Errorf("invalid type format %T", t)
89+ n, err := getTokenTypeName[T]()
94+ return fmt.Errorf("cannot resume from this poller token. token is for type %s, not %s", tt, n)
99+// used if the operation synchronously completed
100+type NopPoller[T any] struct {
105+// NewNopPoller creates a NopPoller from the provided response.
106+// It unmarshals the response body into an instance of T.
107+func NewNopPoller[T any](resp *http.Response) (*NopPoller[T], error) {
108+ np := &NopPoller[T]{resp: resp}
109+ if resp.StatusCode == http.StatusNoContent {
112+ payload, err := exported.Payload(resp, nil)
116+ if len(payload) == 0 {
119+ if err = json.Unmarshal(payload, &np.result); err != nil {
125+func (*NopPoller[T]) Done() bool {
129+func (p *NopPoller[T]) Poll(context.Context) (*http.Response, error) {
133+func (p *NopPoller[T]) Result(ctx context.Context, out *T) error {
138+// PollHelper creates and executes the request, calling update() with the response.
139+// If the request fails, the update func is not called.
140+// The update func returns the state of the operation for logging purposes or an error
141+// if it fails to extract the required state from the response.
142+func PollHelper(ctx context.Context, endpoint string, pl azexported.Pipeline, update func(resp *http.Response) (string, error)) error {
143+ req, err := azexported.NewRequest(ctx, http.MethodGet, endpoint)
147+ resp, err := pl.Do(req)
151+ state, err := update(resp)
155+ log.Writef(log.EventLRO, "State %s", state)
159+// ResultHelper processes the response as success or failure.
160+// In the success case, it unmarshals the payload into either a new instance of T or out.
161+// In the failure case, it creates an *azcore.Response error from the response.
162+func ResultHelper[T any](resp *http.Response, failed bool, jsonPath string, out *T) error {
163+ // short-circuit the simple success case with no response body to unmarshal
164+ if resp.StatusCode == http.StatusNoContent {
168+ defer resp.Body.Close()
169+ if !poller.StatusCodeValid(resp) || failed {
170+ // the LRO failed. unmarshall the error and update state
171+ return azexported.NewResponseError(resp)
175+ payload, err := exported.Payload(resp, nil)
180+ if jsonPath != "" && len(payload) > 0 {
181+ // extract the payload from the specified JSON path.
182+ // do this before the zero-length check in case there
184+ jsonBody := map[string]json.RawMessage{}
185+ if err = json.Unmarshal(payload, &jsonBody); err != nil {
188+ payload = jsonBody[jsonPath]
191+ if len(payload) == 0 {
195+ if err = json.Unmarshal(payload, out); err != nil {
201+// IsNonTerminalHTTPStatusCode returns true if the HTTP status code should be
202+// considered non-terminal thus eligible for retry.
203+func IsNonTerminalHTTPStatusCode(resp *http.Response) bool {
204+ return exported.HasStatusCode(resp,
205+ http.StatusRequestTimeout, // 408
206+ http.StatusTooManyRequests, // 429
207+ http.StatusInternalServerError, // 500
208+ http.StatusBadGateway, // 502
209+ http.StatusServiceUnavailable, // 503
210+ http.StatusGatewayTimeout, // 504
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.gonew file+44
@@ -0,0 +1,44 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
10+ ContentTypeAppJSON = "application/json"
11+ ContentTypeAppXML = "application/xml"
12+ ContentTypeTextPlain = "text/plain"
16+ HeaderAuthorization = "Authorization"
17+ HeaderAuxiliaryAuthorization = "x-ms-authorization-auxiliary"
18+ HeaderAzureAsync = "Azure-AsyncOperation"
19+ HeaderContentLength = "Content-Length"
20+ HeaderContentType = "Content-Type"
21+ HeaderFakePollerStatus = "Fake-Poller-Status"
22+ HeaderLocation = "Location"
23+ HeaderOperationLocation = "Operation-Location"
24+ HeaderRetryAfter = "Retry-After"
25+ HeaderRetryAfterMS = "Retry-After-Ms"
26+ HeaderUserAgent = "User-Agent"
27+ HeaderWWWAuthenticate = "WWW-Authenticate"
28+ HeaderXMSClientRequestID = "x-ms-client-request-id"
29+ HeaderXMSRequestID = "x-ms-request-id"
30+ HeaderXMSErrorCode = "x-ms-error-code"
31+ HeaderXMSRetryAfterMS = "x-ms-retry-after-ms"
34+const BearerTokenPrefix = "Bearer "
36+const TracingNamespaceAttrName = "az.namespace"
39+ // Module is the name of the calling module used in telemetry data.
42+ // Version is the semantic version (see http://semver.org) of this module.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/shared.gonew file+149
@@ -0,0 +1,149 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
19+// NOTE: when adding a new context key type, it likely needs to be
20+// added to the deny-list of key types in ContextWithDeniedValues
22+// CtxWithHTTPHeaderKey is used as a context key for adding/retrieving http.Header.
23+type CtxWithHTTPHeaderKey struct{}
25+// CtxWithRetryOptionsKey is used as a context key for adding/retrieving RetryOptions.
26+type CtxWithRetryOptionsKey struct{}
28+// CtxWithCaptureResponse is used as a context key for retrieving the raw response.
29+type CtxWithCaptureResponse struct{}
31+// CtxWithTracingTracer is used as a context key for adding/retrieving tracing.Tracer.
32+type CtxWithTracingTracer struct{}
34+// CtxAPINameKey is used as a context key for adding/retrieving the API name.
35+type CtxAPINameKey struct{}
37+// Delay waits for the duration to elapse or the context to be cancelled.
38+func Delay(ctx context.Context, delay time.Duration) error {
40+ case <-time.After(delay):
47+// RetryAfter returns non-zero if the response contains one of the headers with a "retry after" value.
48+// Headers are checked in the following order: retry-after-ms, x-ms-retry-after-ms, retry-after
49+func RetryAfter(resp *http.Response) time.Duration {
54+ type retryData struct {
58+ // custom is used when the regular algorithm failed and is optional.
59+ // the returned duration is used verbatim (units is not applied).
60+ custom func(string) time.Duration
63+ nop := func(string) time.Duration { return 0 }
65+ // the headers are listed in order of preference
66+ retries := []retryData{
68+ header: HeaderRetryAfterMS,
69+ units: time.Millisecond,
73+ header: HeaderXMSRetryAfterMS,
74+ units: time.Millisecond,
78+ header: HeaderRetryAfter,
81+ // retry-after values are expressed in either number of
82+ // seconds or an HTTP-date indicating when to try again
83+ custom: func(ra string) time.Duration {
84+ t, err := time.Parse(time.RFC1123, ra)
93+ for _, retry := range retries {
94+ v := resp.Header.Get(retry.header)
98+ if retryAfter, _ := strconv.Atoi(v); retryAfter > 0 {
99+ return time.Duration(retryAfter) * retry.units
100+ } else if d := retry.custom(v); d > 0 {
108+// TypeOfT returns the type of the generic type param.
109+func TypeOfT[T any]() reflect.Type {
110+ // you can't, at present, obtain the type of
111+ // a type parameter, so this is the trick
112+ return reflect.TypeOf((*T)(nil)).Elem()
115+// TransportFunc is a helper to use a first-class func to satisfy the Transporter interface.
116+type TransportFunc func(*http.Request) (*http.Response, error)
118+// Do implements the Transporter interface for the TransportFunc type.
119+func (pf TransportFunc) Do(req *http.Request) (*http.Response, error) {
123+// ValidateModVer verifies that moduleVersion is a valid semver 2.0 string.
124+func ValidateModVer(moduleVersion string) error {
125+ modVerRegx := regexp.MustCompile(`^v\d+\.\d+\.\d+(?:-[a-zA-Z0-9_.-]+)?$`)
126+ if !modVerRegx.MatchString(moduleVersion) {
127+ return fmt.Errorf("malformed moduleVersion param value %s", moduleVersion)
132+// ContextWithDeniedValues wraps an existing [context.Context], denying access to certain context values.
133+// Pipeline policies that create new requests to be sent down their own pipeline MUST wrap the caller's
134+// context with an instance of this type. This is to prevent context values from flowing across disjoint
135+// requests which can have unintended side-effects.
136+type ContextWithDeniedValues struct {
140+// Value implements part of the [context.Context] interface.
141+// It acts as a deny-list for certain context keys.
142+func (c *ContextWithDeniedValues) Value(key any) any {
144+ case CtxAPINameKey, CtxWithCaptureResponse, CtxWithHTTPHeaderKey, CtxWithRetryOptionsKey, CtxWithTracingTracer:
147+ return c.Context.Value(key)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/doc.gonew file+10
@@ -0,0 +1,10 @@
4+// Copyright 2017 Microsoft Corporation. All rights reserved.
5+// Use of this source code is governed by an MIT
6+// license that can be found in the LICENSE file.
8+// Package log contains functionality for configuring logging behavior.
9+// Default logging to stderr can be enabled by setting environment variable AZURE_SDK_GO_LOGGING to "all".
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/log/log.gonew file+55
@@ -0,0 +1,55 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
7+// Package log provides functionality for configuring logging facilities.
11+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
14+// Event is used to group entries. Each group can be toggled on or off.
15+type Event = log.Event
18+ // EventRequest entries contain information about HTTP requests.
19+ // This includes information like the URL, query parameters, and headers.
20+ EventRequest Event = "Request"
22+ // EventResponse entries contain information about HTTP responses.
23+ // This includes information like the HTTP status code, headers, and request URL.
24+ EventResponse Event = "Response"
26+ // EventResponseError entries contain information about HTTP responses that returned
27+ // an *azcore.ResponseError (i.e. responses with a non 2xx HTTP status code).
28+ // This includes the contents of ResponseError.Error().
29+ EventResponseError Event = "ResponseError"
31+ // EventRetryPolicy entries contain information specific to the retry policy in use.
32+ EventRetryPolicy Event = "Retry"
34+ // EventLRO entries contain information specific to long-running operations.
35+ // This includes information like polling location, operation state, and sleep intervals.
36+ EventLRO Event = "LongRunningOperation"
39+// SetEvents is used to control which events are written to
40+// the log. By default all log events are writen.
41+// NOTE: this is not goroutine safe and should be called before using SDK clients.
42+func SetEvents(cls ...Event) {
43+ log.SetEvents(cls...)
46+// SetListener will set the Logger to write to the specified Listener.
47+// NOTE: this is not goroutine safe and should be called before using SDK clients.
48+func SetListener(lst func(Event, string)) {
52+// for testing purposes
54+ log.TestResetEvents()
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/doc.gonew file+10
@@ -0,0 +1,10 @@
4+// Copyright 2017 Microsoft Corporation. All rights reserved.
5+// Use of this source code is governed by an MIT
6+// license that can be found in the LICENSE file.
8+// Package policy contains the definitions needed for configuring in-box pipeline policies
9+// and creating custom policies.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy/policy.gonew file+198
@@ -0,0 +1,198 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
20+// Policy represents an extensibility point for the Pipeline that can mutate the specified
21+// Request and react to the received Response.
22+type Policy = exported.Policy
24+// Transporter represents an HTTP pipeline transport used to send HTTP requests and receive responses.
25+type Transporter = exported.Transporter
27+// Request is an abstraction over the creation of an HTTP request as it passes through the pipeline.
28+// Don't use this type directly, use runtime.NewRequest() instead.
29+type Request = exported.Request
31+// ClientOptions contains optional settings for a client's pipeline.
32+// Instances can be shared across calls to SDK client constructors when uniform configuration is desired.
33+// Zero-value fields will have their specified default values applied during use.
34+type ClientOptions struct {
35+ // APIVersion overrides the default version requested of the service.
36+ // Set with caution as this package version has not been tested with arbitrary service versions.
39+ // Cloud specifies a cloud for the client. The default is Azure Public Cloud.
40+ Cloud cloud.Configuration
42+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
43+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
44+ // WARNING: setting this to true will allow sending the credential in clear text. Use with caution.
45+ InsecureAllowCredentialWithHTTP bool
47+ // Logging configures the built-in logging policy.
50+ // Retry configures the built-in retry policy.
53+ // Telemetry configures the built-in telemetry policy.
54+ Telemetry TelemetryOptions
56+ // TracingProvider configures the tracing provider.
57+ // It defaults to a no-op tracer.
58+ TracingProvider tracing.Provider
60+ // Transport sets the transport for HTTP requests.
61+ Transport Transporter
63+ // PerCallPolicies contains custom policies to inject into the pipeline.
64+ // Each policy is executed once per request.
65+ PerCallPolicies []Policy
67+ // PerRetryPolicies contains custom policies to inject into the pipeline.
68+ // Each policy is executed once per request, and for each retry of that request.
69+ PerRetryPolicies []Policy
72+// LogOptions configures the logging policy's behavior.
73+type LogOptions struct {
74+ // IncludeBody indicates if request and response bodies should be included in logging.
75+ // The default value is false.
76+ // NOTE: enabling this can lead to disclosure of sensitive information, use with care.
79+ // AllowedHeaders is the slice of headers to log with their values intact.
80+ // All headers not in the slice will have their values REDACTED.
81+ // Applies to request and response headers.
82+ AllowedHeaders []string
84+ // AllowedQueryParams is the slice of query parameters to log with their values intact.
85+ // All query parameters not in the slice will have their values REDACTED.
86+ AllowedQueryParams []string
89+// RetryOptions configures the retry policy's behavior.
90+// Zero-value fields will have their specified default values applied during use.
91+// This allows for modification of a subset of fields.
92+type RetryOptions struct {
93+ // MaxRetries specifies the maximum number of attempts a failed operation will be retried
94+ // before producing an error.
95+ // The default value is three. A value less than zero means one try and no retries.
98+ // TryTimeout indicates the maximum time allowed for any single try of an HTTP request.
99+ // This is disabled by default. Specify a value greater than zero to enable.
100+ // NOTE: Setting this to a small value might cause premature HTTP request time-outs.
101+ TryTimeout time.Duration
103+ // RetryDelay specifies the initial amount of delay to use before retrying an operation.
104+ // The value is used only if the HTTP response does not contain a Retry-After header.
105+ // The delay increases exponentially with each retry up to the maximum specified by MaxRetryDelay.
106+ // The default value is four seconds. A value less than zero means no delay between retries.
107+ RetryDelay time.Duration
109+ // MaxRetryDelay specifies the maximum delay allowed before retrying an operation.
110+ // Typically the value is greater than or equal to the value specified in RetryDelay.
111+ // The default Value is 60 seconds. A value less than zero means there is no cap.
112+ MaxRetryDelay time.Duration
114+ // StatusCodes specifies the HTTP status codes that indicate the operation should be retried.
115+ // A nil slice will use the following values.
116+ // http.StatusRequestTimeout 408
117+ // http.StatusTooManyRequests 429
118+ // http.StatusInternalServerError 500
119+ // http.StatusBadGateway 502
120+ // http.StatusServiceUnavailable 503
121+ // http.StatusGatewayTimeout 504
122+ // Specifying values will replace the default values.
123+ // Specifying an empty slice will disable retries for HTTP status codes.
126+ // ShouldRetry evaluates if the retry policy should retry the request.
127+ // When specified, the function overrides comparison against the list of
128+ // HTTP status codes and error checking within the retry policy. Context
129+ // and NonRetriable errors remain evaluated before calling ShouldRetry.
130+ // The *http.Response and error parameters are mutually exclusive, i.e.
131+ // if one is nil, the other is not nil.
132+ // A return value of true means the retry policy should retry.
133+ ShouldRetry func(*http.Response, error) bool
136+// TelemetryOptions configures the telemetry policy's behavior.
137+type TelemetryOptions struct {
138+ // ApplicationID is an application-specific identification string to add to the User-Agent.
139+ // It has a maximum length of 24 characters and must not contain any spaces.
140+ ApplicationID string
142+ // Disabled will prevent the addition of any telemetry data to the User-Agent.
146+// TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token.
147+type TokenRequestOptions = exported.TokenRequestOptions
149+// BearerTokenOptions configures the bearer token policy's behavior.
150+type BearerTokenOptions struct {
151+ // AuthorizationHandler allows SDK developers to run client-specific logic when BearerTokenPolicy must authorize a request.
152+ // When this field isn't set, the policy follows its default behavior of authorizing every request with a bearer token from
153+ // its given credential.
154+ AuthorizationHandler AuthorizationHandler
156+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
157+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
158+ // WARNING: setting this to true will allow sending the bearer token in clear text. Use with caution.
159+ InsecureAllowCredentialWithHTTP bool
162+// AuthorizationHandler allows SDK developers to insert custom logic that runs when BearerTokenPolicy must authorize a request.
163+type AuthorizationHandler struct {
164+ // OnRequest provides TokenRequestOptions the policy can use to acquire a token for a request. The policy calls OnRequest
165+ // whenever it needs a token and may call it multiple times for the same request. Its func parameter authorizes the request
166+ // with a token from the policy's credential. Implementations that need to perform I/O should use the Request's context,
167+ // available from Request.Raw().Context(). When OnRequest returns an error, the policy propagates that error and doesn't send
168+ // the request. When OnRequest is nil, the policy follows its default behavior, which is to authorize the request with a token
169+ // from its credential according to its configuration.
170+ OnRequest func(*Request, func(TokenRequestOptions) error) error
172+ // OnChallenge allows clients to implement custom HTTP authentication challenge handling. BearerTokenPolicy calls it upon
173+ // receiving a 401 response containing multiple Bearer challenges or a challenge BearerTokenPolicy itself can't handle.
174+ // OnChallenge is responsible for parsing challenge(s) (the Response's WWW-Authenticate header) and reauthorizing the
175+ // Request accordingly. Its func argument authorizes the Request with a token from the policy's credential using the given
176+ // TokenRequestOptions. OnChallenge should honor the Request's context, available from Request.Raw().Context(). When
177+ // OnChallenge returns nil, the policy will send the Request again.
178+ OnChallenge func(*Request, *http.Response, func(TokenRequestOptions) error) error
181+// WithCaptureResponse applies the HTTP response retrieval annotation to the parent context.
182+// The resp parameter will contain the HTTP response after the request has completed.
183+func WithCaptureResponse(parent context.Context, resp **http.Response) context.Context {
184+ return context.WithValue(parent, shared.CtxWithCaptureResponse{}, resp)
187+// WithHTTPHeader adds the specified http.Header to the parent context.
188+// Use this to specify custom HTTP headers at the API-call level.
189+// Any overlapping headers will have their values replaced with the values specified here.
190+func WithHTTPHeader(parent context.Context, header http.Header) context.Context {
191+ return context.WithValue(parent, shared.CtxWithHTTPHeaderKey{}, header)
194+// WithRetryOptions adds the specified RetryOptions to the parent context.
195+// Use this to specify custom RetryOptions at the API-call level.
196+func WithRetryOptions(parent context.Context, options RetryOptions) context.Context {
197+ return context.WithValue(parent, shared.CtxWithRetryOptionsKey{}, options)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/doc.gonew file+10
@@ -0,0 +1,10 @@
4+// Copyright 2017 Microsoft Corporation. All rights reserved.
5+// Use of this source code is governed by an MIT
6+// license that can be found in the LICENSE file.
8+// Package runtime contains various facilities for creating requests and handling responses.
9+// The content is intended for SDK authors.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/errors.gonew file+27
@@ -0,0 +1,27 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
12+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
15+// NewResponseError creates an *azcore.ResponseError from the provided HTTP response.
16+// Call this when a service request returns a non-successful status code.
17+// The error code will be extracted from the *http.Response, either from the x-ms-error-code
18+// header (preferred) or attempted to be parsed from the response body.
19+func NewResponseError(resp *http.Response) error {
20+ return exported.NewResponseError(resp)
23+// NewResponseErrorWithErrorCode creates an *azcore.ResponseError from the provided HTTP response and errorCode.
24+// Use this variant when the error code is in a non-standard location.
25+func NewResponseErrorWithErrorCode(resp *http.Response, errorCode string) error {
26+ return exported.NewResponseErrorWithErrorCode(resp, errorCode)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pager.gonew file+138
@@ -0,0 +1,138 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
21+// PagingHandler contains the required data for constructing a Pager.
22+type PagingHandler[T any] struct {
23+ // More returns a boolean indicating if there are more pages to fetch.
24+ // It uses the provided page to make the determination.
27+ // Fetcher fetches the first and subsequent pages.
28+ Fetcher func(context.Context, *T) (T, error)
30+ // Tracer contains the Tracer from the client that's creating the Pager.
31+ Tracer tracing.Tracer
34+// Pager provides operations for iterating over paged responses.
35+// Methods on this type are not safe for concurrent use.
36+type Pager[T any] struct {
38+ handler PagingHandler[T]
39+ tracer tracing.Tracer
43+// NewPager creates an instance of Pager using the specified PagingHandler.
44+// Pass a non-nil T for firstPage if the first page has already been retrieved.
45+func NewPager[T any](handler PagingHandler[T]) *Pager[T] {
48+ tracer: handler.Tracer,
53+// More returns true if there are more pages to retrieve.
54+func (p *Pager[T]) More() bool {
55+ if p.current != nil {
56+ return p.handler.More(*p.current)
61+// NextPage advances the pager to the next page.
62+func (p *Pager[T]) NextPage(ctx context.Context) (T, error) {
63+ if p.current != nil {
65+ // we get here if it's an LRO-pager, we already have the first page
67+ return *p.current, nil
68+ } else if !p.handler.More(*p.current) {
69+ return *new(T), errors.New("no more pages")
72+ // non-LRO case, first page
77+ ctx, endSpan := StartSpan(ctx, fmt.Sprintf("%s.NextPage", shortenTypeName(reflect.TypeOf(*p).Name())), p.tracer, nil)
78+ defer func() { endSpan(err) }()
80+ resp, err := p.handler.Fetcher(ctx, p.current)
85+ return *p.current, nil
88+// UnmarshalJSON implements the json.Unmarshaler interface for Pager[T].
89+func (p *Pager[T]) UnmarshalJSON(data []byte) error {
90+ return json.Unmarshal(data, &p.current)
93+// FetcherForNextLinkOptions contains the optional values for [FetcherForNextLink].
94+type FetcherForNextLinkOptions struct {
95+ // NextReq is the func to be called when requesting subsequent pages.
96+ // Used for paged operations that have a custom next link operation.
97+ NextReq func(context.Context, string) (*policy.Request, error)
99+ // StatusCodes contains additional HTTP status codes indicating success.
100+ // The default value is http.StatusOK.
104+// FetcherForNextLink is a helper containing boilerplate code to simplify creating a PagingHandler[T].Fetcher from a next link URL.
105+// - ctx is the [context.Context] controlling the lifetime of the HTTP operation
106+// - pl is the [Pipeline] used to dispatch the HTTP request
107+// - nextLink is the URL used to fetch the next page. the empty string indicates the first page is to be requested
108+// - firstReq is the func to be called when creating the request for the first page
109+// - options contains any optional parameters, pass nil to accept the default values
110+func FetcherForNextLink(ctx context.Context, pl Pipeline, nextLink string, firstReq func(context.Context) (*policy.Request, error), options *FetcherForNextLinkOptions) (*http.Response, error) {
111+ var req *policy.Request
114+ options = &FetcherForNextLinkOptions{}
117+ req, err = firstReq(ctx)
118+ } else if nextLink, err = EncodeQueryParams(nextLink); err == nil {
119+ if options.NextReq != nil {
120+ req, err = options.NextReq(ctx, nextLink)
122+ req, err = NewRequest(ctx, http.MethodGet, nextLink)
128+ resp, err := pl.Do(req)
132+ successCodes := []int{http.StatusOK}
133+ successCodes = append(successCodes, options.StatusCodes...)
134+ if !HasStatusCode(resp, successCodes...) {
135+ return nil, NewResponseError(resp)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/pipeline.gonew file+94
@@ -0,0 +1,94 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
10+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
11+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
14+// PipelineOptions contains Pipeline options for SDK developers
15+type PipelineOptions struct {
16+ // AllowedHeaders is the slice of headers to log with their values intact.
17+ // All headers not in the slice will have their values REDACTED.
18+ // Applies to request and response headers.
19+ AllowedHeaders []string
21+ // AllowedQueryParameters is the slice of query parameters to log with their values intact.
22+ // All query parameters not in the slice will have their values REDACTED.
23+ AllowedQueryParameters []string
25+ // APIVersion overrides the default version requested of the service.
26+ // Set with caution as this package version has not been tested with arbitrary service versions.
27+ APIVersion APIVersionOptions
29+ // PerCall contains custom policies to inject into the pipeline.
30+ // Each policy is executed once per request.
31+ PerCall []policy.Policy
33+ // PerRetry contains custom policies to inject into the pipeline.
34+ // Each policy is executed once per request, and for each retry of that request.
35+ PerRetry []policy.Policy
37+ // Tracing contains options used to configure distributed tracing.
38+ Tracing TracingOptions
41+// TracingOptions contains tracing options for SDK developers.
42+type TracingOptions struct {
43+ // Namespace contains the value to use for the az.namespace span attribute.
47+// Pipeline represents a primitive for sending HTTP requests and receiving responses.
48+// Its behavior can be extended by specifying policies during construction.
49+type Pipeline = exported.Pipeline
51+// NewPipeline creates a pipeline from connection options, with any additional policies as specified.
52+// Policies from ClientOptions are placed after policies from PipelineOptions.
53+// The module and version parameters are used by the telemetry policy, when enabled.
54+func NewPipeline(module, version string, plOpts PipelineOptions, options *policy.ClientOptions) Pipeline {
55+ cp := policy.ClientOptions{}
59+ if len(plOpts.AllowedHeaders) > 0 {
60+ headers := make([]string, len(plOpts.AllowedHeaders)+len(cp.Logging.AllowedHeaders))
61+ copy(headers, plOpts.AllowedHeaders)
62+ headers = append(headers, cp.Logging.AllowedHeaders...)
63+ cp.Logging.AllowedHeaders = headers
65+ if len(plOpts.AllowedQueryParameters) > 0 {
66+ qp := make([]string, len(plOpts.AllowedQueryParameters)+len(cp.Logging.AllowedQueryParams))
67+ copy(qp, plOpts.AllowedQueryParameters)
68+ qp = append(qp, cp.Logging.AllowedQueryParams...)
69+ cp.Logging.AllowedQueryParams = qp
71+ // we put the includeResponsePolicy at the very beginning so that the raw response
72+ // is populated with the final response (some policies might mutate the response)
73+ policies := []policy.Policy{exported.PolicyFunc(includeResponsePolicy)}
74+ if cp.APIVersion != "" {
75+ policies = append(policies, newAPIVersionPolicy(cp.APIVersion, &plOpts.APIVersion))
77+ if !cp.Telemetry.Disabled {
78+ policies = append(policies, NewTelemetryPolicy(module, version, &cp.Telemetry))
80+ policies = append(policies, plOpts.PerCall...)
81+ policies = append(policies, cp.PerCallPolicies...)
82+ policies = append(policies, NewRetryPolicy(&cp.Retry))
83+ policies = append(policies, plOpts.PerRetry...)
84+ policies = append(policies, cp.PerRetryPolicies...)
85+ policies = append(policies, exported.PolicyFunc(httpHeaderPolicy))
86+ policies = append(policies, newHTTPTracePolicy(cp.Logging.AllowedQueryParams))
87+ policies = append(policies, NewLogPolicy(&cp.Logging))
88+ policies = append(policies, exported.PolicyFunc(bodyDownloadPolicy))
89+ transport := cp.Transport
90+ if transport == nil {
91+ transport = defaultHTTPClient
93+ return exported.NewPipeline(transport, policies...)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_api_version.gonew file+75
@@ -0,0 +1,75 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
17+// APIVersionOptions contains options for API versions
18+type APIVersionOptions struct {
19+ // Location indicates where to set the version on a request, for example in a header or query param
20+ Location APIVersionLocation
21+ // Name is the name of the header or query parameter, for example "api-version"
25+// APIVersionLocation indicates which part of a request identifies the service version
26+type APIVersionLocation int
29+ // APIVersionLocationQueryParam indicates a query parameter
30+ APIVersionLocationQueryParam = 0
31+ // APIVersionLocationHeader indicates a header
32+ APIVersionLocationHeader = 1
35+// newAPIVersionPolicy constructs an APIVersionPolicy. If version is "", Do will be a no-op. If version
36+// isn't empty and opts.Name is empty, Do will return an error.
37+func newAPIVersionPolicy(version string, opts *APIVersionOptions) *apiVersionPolicy {
39+ opts = &APIVersionOptions{}
41+ return &apiVersionPolicy{location: opts.Location, name: opts.Name, version: version}
44+// apiVersionPolicy enables users to set the API version of every request a client sends.
45+type apiVersionPolicy struct {
46+ // location indicates whether "name" refers to a query parameter or header.
47+ location APIVersionLocation
49+ // name of the query param or header whose value should be overridden; provided by the client.
52+ // version is the value (provided by the user) that replaces the default version value.
56+// Do sets the request's API version, if the policy is configured to do so, replacing any prior value.
57+func (a *apiVersionPolicy) Do(req *policy.Request) (*http.Response, error) {
60+ // user set ClientOptions.APIVersion but the client ctor didn't set PipelineOptions.APIVersionOptions
61+ return nil, errors.New("this client doesn't support overriding its API version")
64+ case APIVersionLocationHeader:
65+ req.Raw().Header.Set(a.name, a.version)
66+ case APIVersionLocationQueryParam:
67+ q := req.Raw().URL.Query()
68+ q.Set(a.name, a.version)
69+ req.Raw().URL.RawQuery = q.Encode()
71+ return nil, fmt.Errorf("unknown APIVersionLocation %d", a.location)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.gonew file+236
@@ -0,0 +1,236 @@
1+// Copyright (c) Microsoft Corporation. All rights reserved.
2+// Licensed under the MIT License.
15+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
16+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
18+ "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
19+ "github.com/Azure/azure-sdk-for-go/sdk/internal/temporal"
22+// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential.
23+// It handles [Continuous Access Evaluation] (CAE) challenges. Clients needing to handle
24+// additional authentication challenges, or needing more control over authorization, should
25+// provide a [policy.AuthorizationHandler] in [policy.BearerTokenOptions].
27+// [Continuous Access Evaluation]: https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation
28+type BearerTokenPolicy struct {
29+ // mainResource is the resource to be retreived using the tenant specified in the credential
30+ mainResource *temporal.Resource[exported.AccessToken, acquiringResourceState]
31+ // the following fields are read-only
32+ authzHandler policy.AuthorizationHandler
33+ cred exported.TokenCredential
38+type acquiringResourceState struct {
41+ tro policy.TokenRequestOptions
44+// acquire acquires or updates the resource; only one
45+// thread/goroutine at a time ever calls this function
46+func acquire(state acquiringResourceState) (newResource exported.AccessToken, newExpiration time.Time, err error) {
47+ tk, err := state.p.cred.GetToken(&shared.ContextWithDeniedValues{Context: state.req.Raw().Context()}, state.tro)
49+ return exported.AccessToken{}, time.Time{}, err
51+ return tk, tk.ExpiresOn, nil
54+// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens.
55+// cred: an azcore.TokenCredential implementation such as a credential object from azidentity
56+// scopes: the list of permission scopes required for the token.
57+// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options.
58+func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts *policy.BearerTokenOptions) *BearerTokenPolicy {
60+ opts = &policy.BearerTokenOptions{}
62+ ah := opts.AuthorizationHandler
63+ if ah.OnRequest == nil {
64+ // Set a default OnRequest that simply requests a token with the given scopes. OnChallenge
65+ // doesn't get a default so the policy can use a nil check to determine whether the caller
66+ // provided an implementation.
67+ ah.OnRequest = func(_ *policy.Request, authNZ func(policy.TokenRequestOptions) error) error {
68+ // authNZ sets EnableCAE: true in all cases, no need to duplicate that here
69+ return authNZ(policy.TokenRequestOptions{Scopes: scopes})
72+ return &BearerTokenPolicy{
76+ mainResource: temporal.NewResource(acquire),
77+ allowHTTP: opts.InsecureAllowCredentialWithHTTP,
81+// authenticateAndAuthorize returns a function which authorizes req with a token from the policy's credential
82+func (b *BearerTokenPolicy) authenticateAndAuthorize(req *policy.Request) func(policy.TokenRequestOptions) error {
83+ return func(tro policy.TokenRequestOptions) error {
85+ as := acquiringResourceState{p: b, req: req, tro: tro}
86+ tk, err := b.mainResource.Get(as)
90+ req.Raw().Header.Set(shared.HeaderAuthorization, shared.BearerTokenPrefix+tk.Token)
95+// Do authorizes a request with a bearer token
96+func (b *BearerTokenPolicy) Do(req *policy.Request) (*http.Response, error) {
97+ // skip adding the authorization header if no TokenCredential was provided.
98+ // this prevents a panic that might be hard to diagnose and allows testing
99+ // against http endpoints that don't require authentication.
104+ if err := checkHTTPSForAuth(req, b.allowHTTP); err != nil {
108+ err := b.authzHandler.OnRequest(req, b.authenticateAndAuthorize(req))
110+ return nil, errorinfo.NonRetriableError(err)
113+ res, err := req.Next()
118+ res, err = b.handleChallenge(req, res, false)
122+// handleChallenge handles authentication challenges either directly (for CAE challenges) or by calling
123+// the AuthorizationHandler. It's a no-op when the response doesn't include an authentication challenge.
124+// It will recurse at most once, to handle a CAE challenge following a non-CAE challenge handled by the
125+// AuthorizationHandler.
126+func (b *BearerTokenPolicy) handleChallenge(req *policy.Request, res *http.Response, recursed bool) (*http.Response, error) {
128+ if res.StatusCode == http.StatusUnauthorized {
129+ b.mainResource.Expire()
130+ if res.Header.Get(shared.HeaderWWWAuthenticate) != "" {
131+ caeChallenge, parseErr := parseCAEChallenge(res)
132+ if parseErr != nil {
133+ return res, parseErr
136+ case caeChallenge != nil:
137+ authNZ := func(tro policy.TokenRequestOptions) error {
138+ // Take the TokenRequestOptions provided by OnRequest and add the challenge claims. The value
139+ // will be empty at time of writing because CAE is the only feature involving claims. If in
140+ // the future some client needs to specify unrelated claims, this function may need to merge
141+ // them with the challenge claims.
142+ tro.Claims = caeChallenge.params["claims"]
143+ return b.authenticateAndAuthorize(req)(tro)
145+ if err = b.authzHandler.OnRequest(req, authNZ); err == nil {
146+ if err = req.RewindBody(); err == nil {
147+ res, err = req.Next()
150+ case b.authzHandler.OnChallenge != nil && !recursed:
151+ if err = b.authzHandler.OnChallenge(req, res, b.authenticateAndAuthorize(req)); err == nil {
152+ if err = req.RewindBody(); err == nil {
153+ if res, err = req.Next(); err == nil {
154+ res, err = b.handleChallenge(req, res, true)
158+ // don't retry challenge handling errors
159+ err = errorinfo.NonRetriableError(err)
162+ // return the response to the pipeline
169+func checkHTTPSForAuth(req *policy.Request, allowHTTP bool) error {
170+ if strings.ToLower(req.Raw().URL.Scheme) != "https" && !allowHTTP {
171+ return errorinfo.NonRetriableError(errors.New("authenticated requests are not permitted for non TLS protected (https) endpoints"))
176+// parseCAEChallenge returns a *authChallenge representing Response's CAE challenge (nil when Response has none).
177+// If Response includes a CAE challenge having invalid claims, it returns a NonRetriableError.
178+func parseCAEChallenge(res *http.Response) (*authChallenge, error) {
180+ caeChallenge *authChallenge
183+ for _, c := range parseChallenges(res) {
184+ if c.scheme == "Bearer" {
185+ if claims := c.params["claims"]; claims != "" && c.params["error"] == "insufficient_claims" {
186+ if b, de := base64.StdEncoding.DecodeString(claims); de == nil {
187+ c.params["claims"] = string(b)
190+ // don't include the decoding error because it's something
191+ // unhelpful like "illegal base64 data at input byte 42"
192+ err = errorinfo.NonRetriableError(errors.New("authentication challenge contains invalid claims: " + claims))
198+ return caeChallenge, err
202+ challenge, challengeParams *regexp.Regexp
206+type authChallenge struct {
208+ params map[string]string
211+// parseChallenges assumes authentication challenges have quoted parameter values
212+func parseChallenges(res *http.Response) []authChallenge {
214+ // matches challenges having quoted parameters, capturing scheme and parameters
215+ challenge = regexp.MustCompile(`(?:(\w+) ((?:\w+="[^"]*",?\s*)+))`)
216+ // captures parameter names and values in a match of the above expression
217+ challengeParams = regexp.MustCompile(`(\w+)="([^"]*)"`)
219+ parsed := []authChallenge{}
220+ // WWW-Authenticate can have multiple values, each containing multiple challenges
221+ for _, h := range res.Header.Values(shared.HeaderWWWAuthenticate) {
222+ for _, sm := range challenge.FindAllStringSubmatch(h, -1) {
223+ // sm is [challenge, scheme, params] (see regexp documentation on submatches)
225+ params: make(map[string]string),
228+ for _, sm := range challengeParams.FindAllStringSubmatch(sm[2], -1) {
229+ // sm is [key="value", key, value] (see regexp documentation on submatches)
230+ c.params[sm[1]] = sm[2]
232+ parsed = append(parsed, c)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_body_download.gonew file+72
@@ -0,0 +1,72 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
15+ "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
18+// bodyDownloadPolicy creates a policy object that downloads the response's body to a []byte.
19+func bodyDownloadPolicy(req *policy.Request) (*http.Response, error) {
20+ resp, err := req.Next()
24+ var opValues bodyDownloadPolicyOpValues
25+ // don't skip downloading error response bodies
26+ if req.OperationValue(&opValues); opValues.Skip && resp.StatusCode < 400 {
29+ // Either bodyDownloadPolicyOpValues was not specified (so skip is false)
30+ // or it was specified and skip is false: don't skip downloading the body
31+ _, err = Payload(resp)
33+ return resp, newBodyDownloadError(err, req)
38+// bodyDownloadPolicyOpValues is the struct containing the per-operation values
39+type bodyDownloadPolicyOpValues struct {
43+type bodyDownloadError struct {
47+func newBodyDownloadError(err error, req *policy.Request) error {
48+ // on failure, only retry the request for idempotent operations.
49+ // we currently identify them as DELETE, GET, and PUT requests.
50+ if m := strings.ToUpper(req.Raw().Method); m == http.MethodDelete || m == http.MethodGet || m == http.MethodPut {
51+ // error is safe for retry
54+ // wrap error to avoid retries
55+ return &bodyDownloadError{
60+func (b *bodyDownloadError) Error() string {
61+ return fmt.Sprintf("body download policy: %s", b.err.Error())
64+func (b *bodyDownloadError) NonRetriable() {
68+func (b *bodyDownloadError) Unwrap() error {
72+var _ errorinfo.NonRetriable = (*bodyDownloadError)(nil)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_header.gonew file+40
@@ -0,0 +1,40 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
17+// newHTTPHeaderPolicy creates a policy object that adds custom HTTP headers to a request
18+func httpHeaderPolicy(req *policy.Request) (*http.Response, error) {
19+ // check if any custom HTTP headers have been specified
20+ if header := req.Raw().Context().Value(shared.CtxWithHTTPHeaderKey{}); header != nil {
21+ for k, v := range header.(http.Header) {
22+ // use Set to replace any existing value
23+ // it also canonicalizes the header key
24+ req.Raw().Header.Set(k, v[0])
25+ // add any remaining values
26+ for i := 1; i < len(v); i++ {
27+ req.Raw().Header.Add(k, v[i])
34+// WithHTTPHeader adds the specified http.Header to the parent context.
35+// Use this to specify custom HTTP headers at the API-call level.
36+// Any overlapping headers will have their values replaced with the values specified here.
37+// Deprecated: use [policy.WithHTTPHeader] instead.
38+func WithHTTPHeader(parent context.Context, header http.Header) context.Context {
39+ return policy.WithHTTPHeader(parent, header)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_http_trace.gonew file+154
@@ -0,0 +1,154 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
24+ attrHTTPMethod = "http.method"
25+ attrHTTPURL = "http.url"
26+ attrHTTPUserAgent = "http.user_agent"
27+ attrHTTPStatusCode = "http.status_code"
29+ attrAZClientReqID = "az.client_request_id"
30+ attrAZServiceReqID = "az.service_request_id"
32+ attrNetPeerName = "net.peer.name"
35+// newHTTPTracePolicy creates a new instance of the httpTracePolicy.
36+// - allowedQueryParams contains the user-specified query parameters that don't need to be redacted from the trace
37+func newHTTPTracePolicy(allowedQueryParams []string) exported.Policy {
38+ return &httpTracePolicy{allowedQP: getAllowedQueryParams(allowedQueryParams)}
41+// httpTracePolicy is a policy that creates a trace for the HTTP request and its response
42+type httpTracePolicy struct {
43+ allowedQP map[string]struct{}
46+// Do implements the pipeline.Policy interfaces for the httpTracePolicy type.
47+func (h *httpTracePolicy) Do(req *policy.Request) (resp *http.Response, err error) {
48+ rawTracer := req.Raw().Context().Value(shared.CtxWithTracingTracer{})
49+ if tracer, ok := rawTracer.(tracing.Tracer); ok && tracer.Enabled() {
50+ attributes := []tracing.Attribute{
51+ {Key: attrHTTPMethod, Value: req.Raw().Method},
52+ {Key: attrHTTPURL, Value: getSanitizedURL(*req.Raw().URL, h.allowedQP)},
53+ {Key: attrNetPeerName, Value: req.Raw().URL.Host},
56+ if ua := req.Raw().Header.Get(shared.HeaderUserAgent); ua != "" {
57+ attributes = append(attributes, tracing.Attribute{Key: attrHTTPUserAgent, Value: ua})
59+ if reqID := req.Raw().Header.Get(shared.HeaderXMSClientRequestID); reqID != "" {
60+ attributes = append(attributes, tracing.Attribute{Key: attrAZClientReqID, Value: reqID})
63+ ctx := req.Raw().Context()
64+ ctx, span := tracer.Start(ctx, "HTTP "+req.Raw().Method, &tracing.SpanOptions{
65+ Kind: tracing.SpanKindClient,
66+ Attributes: attributes,
71+ span.SetAttributes(tracing.Attribute{Key: attrHTTPStatusCode, Value: resp.StatusCode})
72+ if resp.StatusCode > 399 {
73+ span.SetStatus(tracing.SpanStatusError, resp.Status)
75+ if reqID := resp.Header.Get(shared.HeaderXMSRequestID); reqID != "" {
76+ span.SetAttributes(tracing.Attribute{Key: attrAZServiceReqID, Value: reqID})
78+ } else if err != nil {
79+ var urlErr *url.Error
80+ if errors.As(err, &urlErr) {
81+ // calling *url.Error.Error() will include the unsanitized URL
82+ // which we don't want. in addition, we already have the HTTP verb
83+ // and sanitized URL in the trace so we aren't losing any info
86+ span.SetStatus(tracing.SpanStatusError, err.Error())
91+ req = req.WithContext(ctx)
93+ resp, err = req.Next()
97+// StartSpanOptions contains the optional values for StartSpan.
98+type StartSpanOptions struct {
99+ // Kind indicates the kind of Span.
100+ Kind tracing.SpanKind
101+ // Attributes contains key-value pairs of attributes for the span.
102+ Attributes []tracing.Attribute
105+// StartSpan starts a new tracing span.
106+// You must call the returned func to terminate the span. Pass the applicable error
107+// if the span will exit with an error condition.
108+// - ctx is the parent context of the newly created context
109+// - name is the name of the span. this is typically the fully qualified name of an API ("Client.Method")
110+// - tracer is the client's Tracer for creating spans
111+// - options contains optional values. pass nil to accept any default values
112+func StartSpan(ctx context.Context, name string, tracer tracing.Tracer, options *StartSpanOptions) (context.Context, func(error)) {
113+ if !tracer.Enabled() {
114+ return ctx, func(err error) {}
117+ // we MUST propagate the active tracer before returning so that the trace policy can access it
118+ ctx = context.WithValue(ctx, shared.CtxWithTracingTracer{}, tracer)
120+ if activeSpan := ctx.Value(ctxActiveSpan{}); activeSpan != nil {
121+ // per the design guidelines, if a SDK method Foo() calls SDK method Bar(),
122+ // then the span for Bar() must be suppressed. however, if Bar() makes a REST
123+ // call, then Bar's HTTP span must be a child of Foo's span.
124+ // however, there is an exception to this rule. if the SDK method Foo() is a
125+ // messaging producer/consumer, and it takes a callback that's a SDK method
126+ // Bar(), then the span for Bar() must _not_ be suppressed.
127+ if kind := activeSpan.(tracing.SpanKind); kind == tracing.SpanKindClient || kind == tracing.SpanKindInternal {
128+ return ctx, func(err error) {}
133+ options = &StartSpanOptions{}
135+ if options.Kind == 0 {
136+ options.Kind = tracing.SpanKindInternal
139+ ctx, span := tracer.Start(ctx, name, &tracing.SpanOptions{
141+ Attributes: options.Attributes,
143+ ctx = context.WithValue(ctx, ctxActiveSpan{}, options.Kind)
144+ return ctx, func(err error) {
146+ errType := strings.Replace(fmt.Sprintf("%T", err), "*exported.", "*azcore.", 1)
147+ span.SetStatus(tracing.SpanStatusError, fmt.Sprintf("%s:\n%s", errType, err.Error()))
153+// ctxActiveSpan is used as a context key for indicating a SDK client span is in progress.
154+type ctxActiveSpan struct{}
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_include_response.gonew file+35
@@ -0,0 +1,35 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
14+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
17+// includeResponsePolicy creates a policy that retrieves the raw HTTP response upon request
18+func includeResponsePolicy(req *policy.Request) (*http.Response, error) {
19+ resp, err := req.Next()
23+ if httpOutRaw := req.Raw().Context().Value(shared.CtxWithCaptureResponse{}); httpOutRaw != nil {
24+ httpOut := httpOutRaw.(**http.Response)
30+// WithCaptureResponse applies the HTTP response retrieval annotation to the parent context.
31+// The resp parameter will contain the HTTP response after the request has completed.
32+// Deprecated: use [policy.WithCaptureResponse] instead.
33+func WithCaptureResponse(parent context.Context, resp **http.Response) context.Context {
34+ return policy.WithCaptureResponse(parent, resp)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_key_credential.gonew file+64
@@ -0,0 +1,64 @@
1+// Copyright (c) Microsoft Corporation. All rights reserved.
2+// Licensed under the MIT License.
9+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
10+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
13+// KeyCredentialPolicy authorizes requests with a [azcore.KeyCredential].
14+type KeyCredentialPolicy struct {
15+ cred *exported.KeyCredential
21+// KeyCredentialPolicyOptions contains the optional values configuring [KeyCredentialPolicy].
22+type KeyCredentialPolicyOptions struct {
23+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
24+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
25+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
26+ InsecureAllowCredentialWithHTTP bool
28+ // Prefix is used if the key requires a prefix before it's inserted into the HTTP request.
32+// NewKeyCredentialPolicy creates a new instance of [KeyCredentialPolicy].
33+// - cred is the [azcore.KeyCredential] used to authenticate with the service
34+// - header is the name of the HTTP request header in which the key is placed
35+// - options contains optional configuration, pass nil to accept the default values
36+func NewKeyCredentialPolicy(cred *exported.KeyCredential, header string, options *KeyCredentialPolicyOptions) *KeyCredentialPolicy {
38+ options = &KeyCredentialPolicyOptions{}
40+ return &KeyCredentialPolicy{
43+ prefix: options.Prefix,
44+ allowHTTP: options.InsecureAllowCredentialWithHTTP,
48+// Do implementes the Do method on the [policy.Polilcy] interface.
49+func (k *KeyCredentialPolicy) Do(req *policy.Request) (*http.Response, error) {
50+ // skip adding the authorization header if no KeyCredential was provided.
51+ // this prevents a panic that might be hard to diagnose and allows testing
52+ // against http endpoints that don't require authentication.
54+ if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil {
57+ val := exported.KeyCredentialGet(k.cred)
61+ req.Raw().Header.Add(k.header, val)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_logging.gonew file+264
@@ -0,0 +1,264 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
21+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
22+ "github.com/Azure/azure-sdk-for-go/sdk/internal/diag"
25+type logPolicy struct {
27+ allowedHeaders map[string]struct{}
28+ allowedQP map[string]struct{}
31+// NewLogPolicy creates a request/response logging policy object configured using the specified options.
32+// Pass nil to accept the default values; this is the same as passing a zero-value options.
33+func NewLogPolicy(o *policy.LogOptions) policy.Policy {
35+ o = &policy.LogOptions{}
37+ // construct default hash set of allowed headers
38+ allowedHeaders := map[string]struct{}{
42+ "content-length": {},
48+ "if-modified-since": {},
50+ "if-unmodified-since": {},
58+ "transfer-encoding": {},
60+ "www-authenticate": {},
61+ "x-ms-request-id": {},
62+ "x-ms-client-request-id": {},
63+ "x-ms-return-client-request-id": {},
65+ // add any caller-specified allowed headers to the set
66+ for _, ah := range o.AllowedHeaders {
67+ allowedHeaders[strings.ToLower(ah)] = struct{}{}
69+ // now do the same thing for query params
70+ allowedQP := getAllowedQueryParams(o.AllowedQueryParams)
72+ includeBody: o.IncludeBody,
73+ allowedHeaders: allowedHeaders,
74+ allowedQP: allowedQP,
78+// getAllowedQueryParams merges the default set of allowed query parameters
79+// with a custom set (usually comes from client options).
80+func getAllowedQueryParams(customAllowedQP []string) map[string]struct{} {
81+ allowedQP := map[string]struct{}{
84+ for _, qp := range customAllowedQP {
85+ allowedQP[strings.ToLower(qp)] = struct{}{}
90+// logPolicyOpValues is the struct containing the per-operation values
91+type logPolicyOpValues struct {
96+func (p *logPolicy) Do(req *policy.Request) (*http.Response, error) {
97+ // Get the per-operation values. These are saved in the Message's map so that they persist across each retry calling into this policy object.
98+ var opValues logPolicyOpValues
99+ if req.OperationValue(&opValues); opValues.start.IsZero() {
100+ opValues.start = time.Now() // If this is the 1st try, record this operation's start time
102+ opValues.try++ // The first try is #1 (not #0)
103+ req.SetOperationValue(opValues)
105+ // Log the outgoing request as informational
106+ if log.Should(log.EventRequest) {
107+ b := &bytes.Buffer{}
108+ fmt.Fprintf(b, "==> OUTGOING REQUEST (Try=%d)\n", opValues.try)
109+ p.writeRequestWithResponse(b, req, nil, nil)
112+ err = writeReqBody(req, b)
114+ log.Write(log.EventRequest, b.String())
120+ // Set the time for this particular retry operation and then Do the operation.
121+ tryStart := time.Now()
122+ response, err := req.Next() // Make the request
123+ tryEnd := time.Now()
124+ tryDuration := tryEnd.Sub(tryStart)
125+ opDuration := tryEnd.Sub(opValues.start)
127+ if log.Should(log.EventResponse) {
128+ // We're going to log this; build the string to log
129+ b := &bytes.Buffer{}
130+ fmt.Fprintf(b, "==> REQUEST/RESPONSE (Try=%d/%v, OpTime=%v) -- ", opValues.try, tryDuration, opDuration)
131+ if err != nil { // This HTTP request did not get a response from the service
132+ fmt.Fprint(b, "REQUEST ERROR\n")
134+ fmt.Fprint(b, "RESPONSE RECEIVED\n")
137+ p.writeRequestWithResponse(b, req, response, err)
139+ // skip frames runtime.Callers() and runtime.StackTrace()
140+ b.WriteString(diag.StackTrace(2, 32))
141+ } else if p.includeBody {
142+ err = writeRespBody(response, b)
144+ log.Write(log.EventResponse, b.String())
146+ return response, err
149+const redactedValue = "REDACTED"
151+// getSanitizedURL returns a sanitized string for the provided url.URL
152+func getSanitizedURL(u url.URL, allowedQueryParams map[string]struct{}) string {
153+ // redact applicable query params
156+ if _, ok := allowedQueryParams[strings.ToLower(k)]; !ok {
157+ qp.Set(k, redactedValue)
160+ u.RawQuery = qp.Encode()
164+// writeRequestWithResponse appends a formatted HTTP request into a Buffer. If request and/or err are
165+// not nil, then these are also written into the Buffer.
166+func (p *logPolicy) writeRequestWithResponse(b *bytes.Buffer, req *policy.Request, resp *http.Response, err error) {
167+ // Write the request into the buffer.
168+ fmt.Fprint(b, " "+req.Raw().Method+" "+getSanitizedURL(*req.Raw().URL, p.allowedQP)+"\n")
169+ p.writeHeader(b, req.Raw().Header)
171+ fmt.Fprintln(b, " --------------------------------------------------------------------------------")
172+ fmt.Fprint(b, " RESPONSE Status: "+resp.Status+"\n")
173+ p.writeHeader(b, resp.Header)
176+ fmt.Fprintln(b, " --------------------------------------------------------------------------------")
177+ fmt.Fprint(b, " ERROR:\n"+err.Error()+"\n")
181+// formatHeaders appends an HTTP request's or response's header into a Buffer.
182+func (p *logPolicy) writeHeader(b *bytes.Buffer, header http.Header) {
183+ if len(header) == 0 {
184+ b.WriteString(" (no headers)\n")
187+ keys := make([]string, 0, len(header))
188+ // Alphabetize the headers
189+ for k := range header {
190+ keys = append(keys, k)
193+ for _, k := range keys {
194+ // don't use Get() as it will canonicalize k which might cause a mismatch
195+ value := header[k][0]
196+ // redact all header values not in the allow-list
197+ if _, ok := p.allowedHeaders[strings.ToLower(k)]; !ok {
198+ value = redactedValue
200+ fmt.Fprintf(b, " %s: %+v\n", k, value)
204+// returns true if the request/response body should be logged.
205+// this is determined by looking at the content-type header value.
206+func shouldLogBody(b *bytes.Buffer, contentType string) bool {
207+ contentType = strings.ToLower(contentType)
208+ if strings.HasPrefix(contentType, "text") ||
209+ strings.Contains(contentType, "json") ||
210+ strings.Contains(contentType, "xml") {
213+ fmt.Fprintf(b, " Skip logging body for %s\n", contentType)
217+// writes to a buffer, used for logging purposes
218+func writeReqBody(req *policy.Request, b *bytes.Buffer) error {
219+ if req.Raw().Body == nil {
220+ fmt.Fprint(b, " Request contained no body\n")
223+ if ct := req.Raw().Header.Get(shared.HeaderContentType); !shouldLogBody(b, ct) {
226+ body, err := io.ReadAll(req.Raw().Body)
228+ fmt.Fprintf(b, " Failed to read request body: %s\n", err.Error())
231+ if err := req.RewindBody(); err != nil {
238+// writes to a buffer, used for logging purposes
239+func writeRespBody(resp *http.Response, b *bytes.Buffer) error {
240+ ct := resp.Header.Get(shared.HeaderContentType)
242+ fmt.Fprint(b, " Response contained no body\n")
244+ } else if !shouldLogBody(b, ct) {
247+ body, err := Payload(resp)
249+ fmt.Fprintf(b, " Failed to read response body: %s\n", err.Error())
255+ fmt.Fprint(b, " Response contained no body\n")
260+func logBody(b *bytes.Buffer, body []byte) {
261+ fmt.Fprintln(b, " --------------------------------------------------------------------------------")
262+ fmt.Fprintln(b, string(body))
263+ fmt.Fprintln(b, " --------------------------------------------------------------------------------")
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_request_id.gonew file+34
@@ -0,0 +1,34 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
12+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
13+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
14+ "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid"
17+type requestIDPolicy struct{}
19+// NewRequestIDPolicy returns a policy that add the x-ms-client-request-id header
20+func NewRequestIDPolicy() policy.Policy {
21+ return &requestIDPolicy{}
24+func (r *requestIDPolicy) Do(req *policy.Request) (*http.Response, error) {
25+ if req.Raw().Header.Get(shared.HeaderXMSClientRequestID) == "" {
26+ id, err := uuid.New()
30+ req.Raw().Header.Set(shared.HeaderXMSClientRequestID, id.String())
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_retry.gonew file+276
@@ -0,0 +1,276 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
21+ "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo"
22+ "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
26+ defaultMaxRetries = 3
29+func setDefaults(o *policy.RetryOptions) {
30+ if o.MaxRetries == 0 {
31+ o.MaxRetries = defaultMaxRetries
32+ } else if o.MaxRetries < 0 {
36+ // SDK guidelines specify the default MaxRetryDelay is 60 seconds
37+ if o.MaxRetryDelay == 0 {
38+ o.MaxRetryDelay = 60 * time.Second
39+ } else if o.MaxRetryDelay < 0 {
40+ // not really an unlimited cap, but sufficiently large enough to be considered as such
41+ o.MaxRetryDelay = math.MaxInt64
43+ if o.RetryDelay == 0 {
44+ o.RetryDelay = 800 * time.Millisecond
45+ } else if o.RetryDelay < 0 {
48+ if o.StatusCodes == nil {
49+ // NOTE: if you change this list, you MUST update the docs in policy/policy.go
50+ o.StatusCodes = []int{
51+ http.StatusRequestTimeout, // 408
52+ http.StatusTooManyRequests, // 429
53+ http.StatusInternalServerError, // 500
54+ http.StatusBadGateway, // 502
55+ http.StatusServiceUnavailable, // 503
56+ http.StatusGatewayTimeout, // 504
61+func calcDelay(o policy.RetryOptions, try int32) time.Duration { // try is >=1; never 0
62+ // avoid overflow when shifting left
63+ factor := time.Duration(math.MaxInt64)
65+ factor = time.Duration(int64(1<<try) - 1)
68+ delay := factor * o.RetryDelay
70+ // overflow has happened so set to max value
71+ delay = time.Duration(math.MaxInt64)
74+ // Introduce jitter: [0.0, 1.0) / 2 = [0.0, 0.5) + 0.8 = [0.8, 1.3)
75+ jitterMultiplier := rand.Float64()/2 + 0.8 // NOTE: We want math/rand; not crypto/rand
77+ delayFloat := float64(delay) * jitterMultiplier
78+ if delayFloat > float64(math.MaxInt64) {
79+ // the jitter pushed us over MaxInt64, so just use MaxInt64
80+ delay = time.Duration(math.MaxInt64)
82+ delay = time.Duration(delayFloat)
85+ if delay > o.MaxRetryDelay { // MaxRetryDelay is backfilled with non-negative value
86+ delay = o.MaxRetryDelay
92+// NewRetryPolicy creates a policy object configured using the specified options.
93+// Pass nil to accept the default values; this is the same as passing a zero-value options.
94+func NewRetryPolicy(o *policy.RetryOptions) policy.Policy {
96+ o = &policy.RetryOptions{}
98+ p := &retryPolicy{options: *o}
102+type retryPolicy struct {
103+ options policy.RetryOptions
106+func (p *retryPolicy) Do(req *policy.Request) (resp *http.Response, err error) {
107+ options := p.options
108+ // check if the retry options have been overridden for this call
109+ if override := req.Raw().Context().Value(shared.CtxWithRetryOptionsKey{}); override != nil {
110+ options = override.(policy.RetryOptions)
112+ setDefaults(&options)
113+ // Exponential retry algorithm: ((2 ^ attempt) - 1) * delay * random(0.8, 1.2)
114+ // When to retry: connection failure or temporary/timeout.
115+ var rwbody *retryableRequestBody
116+ if req.Body() != nil {
117+ // wrap the body so we control when it's actually closed.
118+ // do this outside the for loop so defers don't accumulate.
119+ rwbody = &retryableRequestBody{body: req.Body()}
120+ defer rwbody.realClose()
125+ // unfortunately we don't have access to the custom allow-list of query params, so we'll redact everything but the default allowed QPs
126+ log.Writef(log.EventRetryPolicy, "=====> Try=%d for %s %s", try, req.Raw().Method, getSanitizedURL(*req.Raw().URL, getAllowedQueryParams(nil)))
128+ // For each try, seek to the beginning of the Body stream. We do this even for the 1st try because
129+ // the stream may not be at offset 0 when we first get it and we want the same behavior for the
130+ // 1st try as for additional tries.
131+ err = req.RewindBody()
135+ // RewindBody() restores Raw().Body to its original state, so set our rewindable after
137+ req.Raw().Body = rwbody
140+ if options.TryTimeout == 0 {
141+ clone := req.Clone(req.Raw().Context())
142+ resp, err = clone.Next()
144+ // Set the per-try time for this particular retry operation and then Do the operation.
145+ tryCtx, tryCancel := context.WithTimeout(req.Raw().Context(), options.TryTimeout)
146+ clone := req.Clone(tryCtx)
147+ resp, err = clone.Next() // Make the request
148+ // if the body was already downloaded or there was an error it's safe to cancel the context now
151+ } else if exported.PayloadDownloaded(resp) {
154+ // must cancel the context after the body has been read and closed
155+ resp.Body = &contextCancelReadCloser{cf: tryCancel, body: resp.Body}
159+ log.Writef(log.EventRetryPolicy, "response %d", resp.StatusCode)
161+ log.Writef(log.EventRetryPolicy, "error %v", err)
164+ if ctxErr := req.Raw().Context().Err(); ctxErr != nil {
165+ // don't retry if the parent context has been cancelled or its deadline exceeded
167+ log.Writef(log.EventRetryPolicy, "abort due to %v", err)
171+ // check if the error is not retriable
172+ var nre errorinfo.NonRetriable
173+ if errors.As(err, &nre) {
174+ // the error says it's not retriable so don't retry
175+ log.Writef(log.EventRetryPolicy, "non-retriable error %T", nre)
179+ if options.ShouldRetry != nil {
180+ // a non-nil ShouldRetry overrides our HTTP status code check
181+ if !options.ShouldRetry(resp, err) {
182+ // predicate says we shouldn't retry
183+ log.Write(log.EventRetryPolicy, "exit due to ShouldRetry")
186+ } else if err == nil && !HasStatusCode(resp, options.StatusCodes...) {
187+ // if there is no error and the response code isn't in the list of retry codes then we're done.
188+ log.Write(log.EventRetryPolicy, "exit due to non-retriable status code")
192+ if try == options.MaxRetries+1 {
193+ // max number of tries has been reached, don't sleep again
194+ log.Writef(log.EventRetryPolicy, "MaxRetries %d exceeded", options.MaxRetries)
198+ // use the delay from retry-after if available
199+ delay := shared.RetryAfter(resp)
201+ delay = calcDelay(options, try)
202+ } else if delay > options.MaxRetryDelay {
203+ // the retry-after delay exceeds the the cap so don't retry
204+ log.Writef(log.EventRetryPolicy, "Retry-After delay %s exceeds MaxRetryDelay of %s", delay, options.MaxRetryDelay)
208+ // drain before retrying so nothing is leaked
211+ log.Writef(log.EventRetryPolicy, "End Try #%d, Delay=%v", try, delay)
213+ case <-time.After(delay):
215+ case <-req.Raw().Context().Done():
216+ err = req.Raw().Context().Err()
217+ log.Writef(log.EventRetryPolicy, "abort due to %v", err)
223+// WithRetryOptions adds the specified RetryOptions to the parent context.
224+// Use this to specify custom RetryOptions at the API-call level.
225+// Deprecated: use [policy.WithRetryOptions] instead.
226+func WithRetryOptions(parent context.Context, options policy.RetryOptions) context.Context {
227+ return policy.WithRetryOptions(parent, options)
230+// ********** The following type/methods implement the retryableRequestBody (a ReadSeekCloser)
232+// This struct is used when sending a body to the network
233+type retryableRequestBody struct {
234+ body io.ReadSeeker // Seeking is required to support retries
237+// Read reads a block of data from an inner stream and reports progress
238+func (b *retryableRequestBody) Read(p []byte) (n int, err error) {
239+ return b.body.Read(p)
242+func (b *retryableRequestBody) Seek(offset int64, whence int) (offsetFromStart int64, err error) {
243+ return b.body.Seek(offset, whence)
246+func (b *retryableRequestBody) Close() error {
247+ // We don't want the underlying transport to close the request body on transient failures so this is a nop.
248+ // The retry policy closes the request body upon success.
252+func (b *retryableRequestBody) realClose() error {
253+ if c, ok := b.body.(io.Closer); ok {
259+// ********** The following type/methods implement the contextCancelReadCloser
261+// contextCancelReadCloser combines an io.ReadCloser with a cancel func.
262+// it ensures the cancel func is invoked once the body has been read and closed.
263+type contextCancelReadCloser struct {
264+ cf context.CancelFunc
268+func (rc *contextCancelReadCloser) Read(p []byte) (n int, err error) {
269+ return rc.body.Read(p)
272+func (rc *contextCancelReadCloser) Close() error {
273+ err := rc.body.Close()
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_sas_credential.gonew file+55
@@ -0,0 +1,55 @@
1+// Copyright (c) Microsoft Corporation. All rights reserved.
2+// Licensed under the MIT License.
9+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
10+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
13+// SASCredentialPolicy authorizes requests with a [azcore.SASCredential].
14+type SASCredentialPolicy struct {
15+ cred *exported.SASCredential
20+// SASCredentialPolicyOptions contains the optional values configuring [SASCredentialPolicy].
21+type SASCredentialPolicyOptions struct {
22+ // InsecureAllowCredentialWithHTTP enables authenticated requests over HTTP.
23+ // By default, authenticated requests to an HTTP endpoint are rejected by the client.
24+ // WARNING: setting this to true will allow sending the authentication key in clear text. Use with caution.
25+ InsecureAllowCredentialWithHTTP bool
28+// NewSASCredentialPolicy creates a new instance of [SASCredentialPolicy].
29+// - cred is the [azcore.SASCredential] used to authenticate with the service
30+// - header is the name of the HTTP request header in which the shared access signature is placed
31+// - options contains optional configuration, pass nil to accept the default values
32+func NewSASCredentialPolicy(cred *exported.SASCredential, header string, options *SASCredentialPolicyOptions) *SASCredentialPolicy {
34+ options = &SASCredentialPolicyOptions{}
36+ return &SASCredentialPolicy{
39+ allowHTTP: options.InsecureAllowCredentialWithHTTP,
43+// Do implementes the Do method on the [policy.Polilcy] interface.
44+func (k *SASCredentialPolicy) Do(req *policy.Request) (*http.Response, error) {
45+ // skip adding the authorization header if no SASCredential was provided.
46+ // this prevents a panic that might be hard to diagnose and allows testing
47+ // against http endpoints that don't require authentication.
49+ if err := checkHTTPSForAuth(req, k.allowHTTP); err != nil {
52+ req.Raw().Header.Add(k.header, exported.SASCredentialGet(k.cred))
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_telemetry.gonew file+83
@@ -0,0 +1,83 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
18+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
21+type telemetryPolicy struct {
22+ telemetryValue string
25+// NewTelemetryPolicy creates a telemetry policy object that adds telemetry information to outgoing HTTP requests.
26+// The format is [<application_id> ]azsdk-go-<mod>/<ver> <platform_info>.
27+// Pass nil to accept the default values; this is the same as passing a zero-value options.
28+func NewTelemetryPolicy(mod, ver string, o *policy.TelemetryOptions) policy.Policy {
30+ o = &policy.TelemetryOptions{}
32+ tp := telemetryPolicy{}
37+ // normalize ApplicationID
38+ if o.ApplicationID != "" {
39+ o.ApplicationID = strings.ReplaceAll(o.ApplicationID, " ", "/")
40+ if len(o.ApplicationID) > 24 {
41+ o.ApplicationID = o.ApplicationID[:24]
43+ b.WriteString(o.ApplicationID)
46+ // mod might be the fully qualified name. in that case, we just want the package name
47+ if i := strings.LastIndex(mod, "/"); i > -1 {
50+ b.WriteString(formatTelemetry(mod, ver))
52+ b.WriteString(platformInfo)
53+ tp.telemetryValue = b.String()
57+func formatTelemetry(comp, ver string) string {
58+ return fmt.Sprintf("azsdk-go-%s/%s", comp, ver)
61+func (p telemetryPolicy) Do(req *policy.Request) (*http.Response, error) {
62+ if p.telemetryValue == "" {
65+ // preserve the existing User-Agent string
66+ if ua := req.Raw().Header.Get(shared.HeaderUserAgent); ua != "" {
67+ p.telemetryValue = fmt.Sprintf("%s %s", p.telemetryValue, ua)
69+ req.Raw().Header.Set(shared.HeaderUserAgent, p.telemetryValue)
73+// NOTE: the ONLY function that should write to this variable is this func
74+var platformInfo = func() string {
75+ operatingSystem := runtime.GOOS // Default OS string
76+ switch operatingSystem {
78+ operatingSystem = os.Getenv("OS") // Get more specific OS information
79+ case "linux": // accept default OS info
80+ case "freebsd": // accept default OS info
82+ return fmt.Sprintf("(%s; %s)", runtime.Version(), operatingSystem)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/poller.gonew file+396
@@ -0,0 +1,396 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
21+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/log"
22+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers"
23+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/async"
24+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/body"
25+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/fake"
26+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/loc"
27+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/pollers/op"
28+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
29+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing"
30+ "github.com/Azure/azure-sdk-for-go/sdk/internal/poller"
33+// FinalStateVia is the enumerated type for the possible final-state-via values.
34+type FinalStateVia = pollers.FinalStateVia
37+ // FinalStateViaAzureAsyncOp indicates the final payload comes from the Azure-AsyncOperation URL.
38+ FinalStateViaAzureAsyncOp = pollers.FinalStateViaAzureAsyncOp
40+ // FinalStateViaLocation indicates the final payload comes from the Location URL.
41+ FinalStateViaLocation = pollers.FinalStateViaLocation
43+ // FinalStateViaOriginalURI indicates the final payload comes from the original URL.
44+ FinalStateViaOriginalURI = pollers.FinalStateViaOriginalURI
46+ // FinalStateViaOpLocation indicates the final payload comes from the Operation-Location URL.
47+ FinalStateViaOpLocation = pollers.FinalStateViaOpLocation
50+// NewPollerOptions contains the optional parameters for NewPoller.
51+type NewPollerOptions[T any] struct {
52+ // FinalStateVia contains the final-state-via value for the LRO.
53+ // NOTE: used only for Azure-AsyncOperation and Operation-Location LROs.
54+ FinalStateVia FinalStateVia
56+ // OperationLocationResultPath contains the JSON path to the result's
57+ // payload when it's included with the terminal success response.
58+ // NOTE: only used for Operation-Location LROs.
59+ OperationLocationResultPath string
61+ // Response contains a preconstructed response type.
62+ // The final payload will be unmarshaled into it and returned.
65+ // Handler[T] contains a custom polling implementation.
66+ Handler PollingHandler[T]
68+ // Tracer contains the Tracer from the client that's creating the Poller.
69+ Tracer tracing.Tracer
72+// NewPoller creates a Poller based on the provided initial response.
73+func NewPoller[T any](resp *http.Response, pl exported.Pipeline, options *NewPollerOptions[T]) (*Poller[T], error) {
75+ options = &NewPollerOptions[T]{}
77+ result := options.Response
81+ if options.Handler != nil {
86+ tracer: options.Tracer,
90+ defer resp.Body.Close()
91+ // this is a back-stop in case the swagger is incorrect (i.e. missing one or more status codes for success).
92+ // ideally the codegen should return an error if the initial response failed and not even create a poller.
93+ if !poller.StatusCodeValid(resp) {
94+ return nil, errors.New("the operation failed or was cancelled")
97+ // determine the polling method
98+ var opr PollingHandler[T]
100+ if fake.Applicable(resp) {
101+ opr, err = fake.New[T](pl, resp)
102+ } else if async.Applicable(resp) {
103+ // async poller must be checked first as it can also have a location header
104+ opr, err = async.New[T](pl, resp, options.FinalStateVia)
105+ } else if op.Applicable(resp) {
106+ // op poller must be checked before loc as it can also have a location header
107+ opr, err = op.New[T](pl, resp, options.FinalStateVia, options.OperationLocationResultPath)
108+ } else if loc.Applicable(resp) {
109+ opr, err = loc.New[T](pl, resp)
110+ } else if body.Applicable(resp) {
111+ // must test body poller last as it's a subset of the other pollers.
112+ // TODO: this is ambiguous for PATCH/PUT if it returns a 200 with no polling headers (sync completion)
113+ opr, err = body.New[T](pl, resp)
114+ } else if m := resp.Request.Method; resp.StatusCode == http.StatusAccepted && (m == http.MethodDelete || m == http.MethodPost) {
115+ // if we get here it means we have a 202 with no polling headers.
116+ // for DELETE and POST this is a hard error per ARM RPC spec.
117+ return nil, errors.New("response is missing polling URL")
119+ opr, err = pollers.NewNopPoller[T](resp)
129+ tracer: options.Tracer,
133+// NewPollerFromResumeTokenOptions contains the optional parameters for NewPollerFromResumeToken.
134+type NewPollerFromResumeTokenOptions[T any] struct {
135+ // Response contains a preconstructed response type.
136+ // The final payload will be unmarshaled into it and returned.
139+ // Handler[T] contains a custom polling implementation.
140+ Handler PollingHandler[T]
142+ // Tracer contains the Tracer from the client that's creating the Poller.
143+ Tracer tracing.Tracer
146+// NewPollerFromResumeToken creates a Poller from a resume token string.
147+func NewPollerFromResumeToken[T any](token string, pl exported.Pipeline, options *NewPollerFromResumeTokenOptions[T]) (*Poller[T], error) {
149+ options = &NewPollerFromResumeTokenOptions[T]{}
151+ result := options.Response
156+ if err := pollers.IsTokenValid[T](token); err != nil {
159+ raw, err := pollers.ExtractToken(token)
163+ var asJSON map[string]any
164+ if err := json.Unmarshal(raw, &asJSON); err != nil {
168+ opr := options.Handler
169+ // now rehydrate the poller based on the encoded poller type
170+ if fake.CanResume(asJSON) {
171+ opr, _ = fake.New[T](pl, nil)
172+ } else if opr != nil {
173+ log.Writef(log.EventLRO, "Resuming custom poller %T.", opr)
174+ } else if async.CanResume(asJSON) {
175+ opr, _ = async.New[T](pl, nil, "")
176+ } else if body.CanResume(asJSON) {
177+ opr, _ = body.New[T](pl, nil)
178+ } else if loc.CanResume(asJSON) {
179+ opr, _ = loc.New[T](pl, nil)
180+ } else if op.CanResume(asJSON) {
181+ opr, _ = op.New[T](pl, nil, "", "")
183+ return nil, fmt.Errorf("unhandled poller token %s", string(raw))
185+ if err := json.Unmarshal(raw, &opr); err != nil {
191+ tracer: options.Tracer,
195+// PollingHandler[T] abstracts the differences among poller implementations.
196+type PollingHandler[T any] interface {
197+ // Done returns true if the LRO has reached a terminal state.
200+ // Poll fetches the latest state of the LRO.
201+ Poll(context.Context) (*http.Response, error)
203+ // Result is called once the LRO has reached a terminal state. It populates the out parameter
204+ // with the result of the operation.
205+ Result(ctx context.Context, out *T) error
208+// Poller encapsulates a long-running operation, providing polling facilities until the operation reaches a terminal state.
209+// Methods on this type are not safe for concurrent use.
210+type Poller[T any] struct {
211+ op PollingHandler[T]
215+ tracer tracing.Tracer
219+// PollUntilDoneOptions contains the optional values for the Poller[T].PollUntilDone() method.
220+type PollUntilDoneOptions struct {
221+ // Frequency is the time to wait between polling intervals in absence of a Retry-After header. Allowed minimum is one second.
222+ // Pass zero to accept the default value (30s).
223+ Frequency time.Duration
226+// PollUntilDone will poll the service endpoint until a terminal state is reached, an error is received, or the context expires.
227+// It internally uses Poll(), Done(), and Result() in its polling loop, sleeping for the specified duration between intervals.
228+// options: pass nil to accept the default values.
229+// NOTE: the default polling frequency is 30 seconds which works well for most operations. However, some operations might
230+// benefit from a shorter or longer duration.
231+func (p *Poller[T]) PollUntilDone(ctx context.Context, options *PollUntilDoneOptions) (res T, err error) {
233+ options = &PollUntilDoneOptions{}
236+ if cp.Frequency == 0 {
237+ cp.Frequency = 30 * time.Second
240+ ctx, endSpan := StartSpan(ctx, fmt.Sprintf("%s.PollUntilDone", shortenTypeName(reflect.TypeOf(*p).Name())), p.tracer, nil)
241+ defer func() { endSpan(err) }()
243+ // skip the floor check when executing tests so they don't take so long
244+ if isTest := flag.Lookup("test.v"); isTest == nil && cp.Frequency < time.Second {
245+ err = errors.New("polling frequency minimum is one second")
250+ logPollUntilDoneExit := func(v any) {
251+ log.Writef(log.EventLRO, "END PollUntilDone() for %T: %v, total time: %s", p.op, v, time.Since(start))
253+ log.Writef(log.EventLRO, "BEGIN PollUntilDone() for %T", p.op)
255+ // initial check for a retry-after header existing on the initial response
256+ if retryAfter := shared.RetryAfter(p.resp); retryAfter > 0 {
257+ log.Writef(log.EventLRO, "initial Retry-After delay for %s", retryAfter.String())
258+ if err = shared.Delay(ctx, retryAfter); err != nil {
259+ logPollUntilDoneExit(err)
264+ // begin polling the endpoint until a terminal state is reached
266+ var resp *http.Response
267+ resp, err = p.Poll(ctx)
269+ logPollUntilDoneExit(err)
273+ logPollUntilDoneExit("succeeded")
274+ res, err = p.Result(ctx)
278+ if retryAfter := shared.RetryAfter(resp); retryAfter > 0 {
279+ log.Writef(log.EventLRO, "Retry-After delay for %s", retryAfter.String())
282+ log.Writef(log.EventLRO, "delay for %s", d.String())
284+ if err = shared.Delay(ctx, d); err != nil {
285+ logPollUntilDoneExit(err)
291+// Poll fetches the latest state of the LRO. It returns an HTTP response or error.
292+// If Poll succeeds, the poller's state is updated and the HTTP response is returned.
293+// If Poll fails, the poller's state is unmodified and the error is returned.
294+// Calling Poll on an LRO that has reached a terminal state will return the last HTTP response.
295+func (p *Poller[T]) Poll(ctx context.Context) (resp *http.Response, err error) {
297+ // the LRO has reached a terminal state, don't poll again
302+ ctx, endSpan := StartSpan(ctx, fmt.Sprintf("%s.Poll", shortenTypeName(reflect.TypeOf(*p).Name())), p.tracer, nil)
303+ defer func() { endSpan(err) }()
305+ resp, err = p.op.Poll(ctx)
313+// Done returns true if the LRO has reached a terminal state.
314+// Once a terminal state is reached, call Result().
315+func (p *Poller[T]) Done() bool {
319+// Result returns the result of the LRO and is meant to be used in conjunction with Poll and Done.
320+// If the LRO completed successfully, a populated instance of T is returned.
321+// If the LRO failed or was canceled, an *azcore.ResponseError error is returned.
322+// Calling this on an LRO in a non-terminal state will return an error.
323+func (p *Poller[T]) Result(ctx context.Context) (res T, err error) {
325+ err = errors.New("poller is in a non-terminal state")
329+ // the result has already been retrieved, return the cached value
338+ ctx, endSpan := StartSpan(ctx, fmt.Sprintf("%s.Result", shortenTypeName(reflect.TypeOf(*p).Name())), p.tracer, nil)
339+ defer func() { endSpan(err) }()
341+ err = p.op.Result(ctx, p.result)
342+ var respErr *exported.ResponseError
343+ if errors.As(err, &respErr) {
344+ if pollers.IsNonTerminalHTTPStatusCode(respErr.RawResponse) {
345+ // the request failed in a non-terminal way.
346+ // don't cache the error or mark the Poller as done
349+ // the LRO failed. record the error
351+ } else if err != nil {
352+ // the call to Result failed, don't cache anything in this case
364+// ResumeToken returns a value representing the poller that can be used to resume
365+// the LRO at a later time. ResumeTokens are unique per service operation.
366+// The token's format should be considered opaque and is subject to change.
367+// Calling this on an LRO in a terminal state will return an error.
368+func (p *Poller[T]) ResumeToken() (string, error) {
370+ return "", errors.New("poller is in a terminal state")
372+ tk, err := pollers.NewResumeToken[T](p.op)
379+// extracts the type name from the string returned from reflect.Value.Name()
380+func shortenTypeName(s string) string {
381+ // the value is formatted as follows
382+ // Poller[module/Package.Type].Method
383+ // we want to shorten the generic type parameter string to Type
384+ // anything we don't recognize will be left as-is
385+ begin := strings.Index(s, "[")
386+ end := strings.Index(s, "]")
387+ if begin == -1 || end == -1 {
391+ typeName := s[begin+1 : end]
392+ if i := strings.LastIndex(typeName, "."); i > -1 {
393+ typeName = typeName[i+1:]
395+ return s[:begin+1] + typeName + s[end:]
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/request.gonew file+281
@@ -0,0 +1,281 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
24+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
25+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
26+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
27+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
28+ "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid"
31+// Base64Encoding is usesd to specify which base-64 encoder/decoder to use when
32+// encoding/decoding a slice of bytes to/from a string.
33+type Base64Encoding = exported.Base64Encoding
36+ // Base64StdFormat uses base64.StdEncoding for encoding and decoding payloads.
37+ Base64StdFormat Base64Encoding = exported.Base64StdFormat
39+ // Base64URLFormat uses base64.RawURLEncoding for encoding and decoding payloads.
40+ Base64URLFormat Base64Encoding = exported.Base64URLFormat
43+// NewRequest creates a new policy.Request with the specified input.
44+// The endpoint MUST be properly encoded before calling this function.
45+func NewRequest(ctx context.Context, httpMethod string, endpoint string) (*policy.Request, error) {
46+ return exported.NewRequest(ctx, httpMethod, endpoint)
49+// NewRequestFromRequest creates a new policy.Request with an existing *http.Request
50+func NewRequestFromRequest(req *http.Request) (*policy.Request, error) {
51+ return exported.NewRequestFromRequest(req)
54+// EncodeQueryParams will parse and encode any query parameters in the specified URL.
55+// Any semicolons will automatically be escaped.
56+func EncodeQueryParams(u string) (string, error) {
57+ before, after, found := strings.Cut(u, "?")
61+ // starting in Go 1.17, url.ParseQuery will reject semicolons in query params.
62+ // so, we must escape them first. note that this assumes that semicolons aren't
63+ // being used as query param separators which is per the current RFC.
65+ // https://github.com/golang/go/issues/25192
66+ // https://github.com/golang/go/issues/50034
67+ qp, err := url.ParseQuery(strings.ReplaceAll(after, ";", "%3B"))
71+ return before + "?" + qp.Encode(), nil
74+// JoinPaths concatenates multiple URL path segments into one path,
75+// inserting path separation characters as required. JoinPaths will preserve
76+// query parameters in the root path
77+func JoinPaths(root string, paths ...string) string {
83+ if strings.Contains(root, "?") {
84+ splitPath := strings.Split(root, "?")
85+ root, qps = splitPath[0], splitPath[1]
88+ p := path.Join(paths...)
89+ // path.Join will remove any trailing slashes.
90+ // if one was provided, preserve it.
91+ if strings.HasSuffix(paths[len(paths)-1], "/") && !strings.HasSuffix(p, "/") {
99+ if strings.HasSuffix(root, "/") && strings.HasPrefix(p, "/") {
100+ root = root[:len(root)-1]
101+ } else if !strings.HasSuffix(root, "/") && !strings.HasPrefix(p, "/") {
107+// EncodeByteArray will base-64 encode the byte slice v.
108+func EncodeByteArray(v []byte, format Base64Encoding) string {
109+ return exported.EncodeByteArray(v, format)
112+// MarshalAsByteArray will base-64 encode the byte slice v, then calls SetBody.
113+// The encoded value is treated as a JSON string.
114+func MarshalAsByteArray(req *policy.Request, v []byte, format Base64Encoding) error {
115+ // send as a JSON string
116+ encode := fmt.Sprintf("\"%s\"", EncodeByteArray(v, format))
117+ // tsp generated code can set Content-Type so we must prefer that
118+ return exported.SetBody(req, exported.NopCloser(strings.NewReader(encode)), shared.ContentTypeAppJSON, false)
121+// MarshalAsJSON calls json.Marshal() to get the JSON encoding of v then calls SetBody.
122+func MarshalAsJSON(req *policy.Request, v any) error {
123+ b, err := json.Marshal(v)
125+ return fmt.Errorf("error marshalling type %T: %s", v, err)
127+ // tsp generated code can set Content-Type so we must prefer that
128+ return exported.SetBody(req, exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppJSON, false)
131+// MarshalAsXML calls xml.Marshal() to get the XML encoding of v then calls SetBody.
132+func MarshalAsXML(req *policy.Request, v any) error {
133+ b, err := xml.Marshal(v)
135+ return fmt.Errorf("error marshalling type %T: %s", v, err)
137+ // inclue the XML header as some services require it
138+ b = []byte(xml.Header + string(b))
139+ return req.SetBody(exported.NopCloser(bytes.NewReader(b)), shared.ContentTypeAppXML)
142+// SetMultipartFormData writes the specified keys/values as multi-part form fields with the specified value.
143+// File content must be specified as an [io.ReadSeekCloser] or [streaming.MultipartContent].
144+// Byte slices will be treated as JSON. All other values are treated as string values.
145+func SetMultipartFormData(req *policy.Request, formData map[string]any) error {
146+ body := bytes.Buffer{}
147+ writer := multipart.NewWriter(&body)
149+ writeContent := func(fieldname, filename string, src io.Reader) error {
150+ fd, err := writer.CreateFormFile(fieldname, filename)
154+ // copy the data to the form file
155+ if _, err = io.Copy(fd, src); err != nil {
161+ quoteEscaper := strings.NewReplacer("\\", "\\\\", `"`, "\\\"")
163+ writeMultipartContent := func(fieldname string, mpc streaming.MultipartContent) error {
164+ if mpc.Body == nil {
165+ return errors.New("streaming.MultipartContent.Body cannot be nil")
168+ // use fieldname for the file name when unspecified
169+ filename := fieldname
171+ if mpc.ContentType == "" && mpc.Filename == "" {
172+ return writeContent(fieldname, filename, mpc.Body)
174+ if mpc.Filename != "" {
175+ filename = mpc.Filename
177+ // this is pretty much copied from multipart.Writer.CreateFormFile
178+ // but lets us set the caller provided Content-Type and filename
179+ h := make(textproto.MIMEHeader)
180+ h.Set("Content-Disposition",
181+ fmt.Sprintf(`form-data; name="%s"; filename="%s"`,
182+ quoteEscaper.Replace(fieldname), quoteEscaper.Replace(filename)))
183+ contentType := "application/octet-stream"
184+ if mpc.ContentType != "" {
185+ contentType = mpc.ContentType
187+ h.Set("Content-Type", contentType)
188+ fd, err := writer.CreatePart(h)
192+ // copy the data to the form file
193+ if _, err = io.Copy(fd, mpc.Body); err != nil {
199+ // the same as multipart.Writer.WriteField but lets us specify the Content-Type
200+ writeField := func(fieldname, contentType string, value string) error {
201+ h := make(textproto.MIMEHeader)
202+ h.Set("Content-Disposition",
203+ fmt.Sprintf(`form-data; name="%s"`, quoteEscaper.Replace(fieldname)))
204+ h.Set("Content-Type", contentType)
205+ fd, err := writer.CreatePart(h)
209+ if _, err = fd.Write([]byte(value)); err != nil {
215+ for k, v := range formData {
216+ if rsc, ok := v.(io.ReadSeekCloser); ok {
217+ if err := writeContent(k, k, rsc); err != nil {
221+ } else if rscs, ok := v.([]io.ReadSeekCloser); ok {
222+ for _, rsc := range rscs {
223+ if err := writeContent(k, k, rsc); err != nil {
228+ } else if mpc, ok := v.(streaming.MultipartContent); ok {
229+ if err := writeMultipartContent(k, mpc); err != nil {
233+ } else if mpcs, ok := v.([]streaming.MultipartContent); ok {
234+ for _, mpc := range mpcs {
235+ if err := writeMultipartContent(k, mpc); err != nil {
243+ contentType := shared.ContentTypeTextPlain
244+ switch tt := v.(type) {
246+ // JSON, don't quote it
247+ content = string(tt)
248+ contentType = shared.ContentTypeAppJSON
252+ // ensure the value is in string format
253+ content = fmt.Sprintf("%v", v)
256+ if err := writeField(k, contentType, content); err != nil {
260+ if err := writer.Close(); err != nil {
263+ return req.SetBody(exported.NopCloser(bytes.NewReader(body.Bytes())), writer.FormDataContentType())
266+// SkipBodyDownload will disable automatic downloading of the response body.
267+func SkipBodyDownload(req *policy.Request) {
268+ req.SetOperationValue(bodyDownloadPolicyOpValues{Skip: true})
271+// CtxAPINameKey is used as a context key for adding/retrieving the API name.
272+type CtxAPINameKey = shared.CtxAPINameKey
274+// NewUUID returns a new UUID using the RFC4122 algorithm.
275+func NewUUID() (string, error) {
276+ u, err := uuid.New()
280+ return u.String(), nil
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/response.gonew file+109
@@ -0,0 +1,109 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
17+ azexported "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
18+ "github.com/Azure/azure-sdk-for-go/sdk/internal/exported"
21+// Payload reads and returns the response body or an error.
22+// On a successful read, the response body is cached.
23+// Subsequent reads will access the cached value.
24+func Payload(resp *http.Response) ([]byte, error) {
25+ return exported.Payload(resp, nil)
28+// HasStatusCode returns true if the Response's status code is one of the specified values.
29+func HasStatusCode(resp *http.Response, statusCodes ...int) bool {
30+ return exported.HasStatusCode(resp, statusCodes...)
33+// UnmarshalAsByteArray will base-64 decode the received payload and place the result into the value pointed to by v.
34+func UnmarshalAsByteArray(resp *http.Response, v *[]byte, format Base64Encoding) error {
35+ p, err := Payload(resp)
39+ return DecodeByteArray(string(p), v, format)
42+// UnmarshalAsJSON calls json.Unmarshal() to unmarshal the received payload into the value pointed to by v.
43+func UnmarshalAsJSON(resp *http.Response, v any) error {
44+ payload, err := Payload(resp)
48+ // TODO: verify early exit is correct
49+ if len(payload) == 0 {
52+ err = removeBOM(resp)
56+ err = json.Unmarshal(payload, v)
58+ err = fmt.Errorf("unmarshalling type %T: %s", v, err)
63+// UnmarshalAsXML calls xml.Unmarshal() to unmarshal the received payload into the value pointed to by v.
64+func UnmarshalAsXML(resp *http.Response, v any) error {
65+ payload, err := Payload(resp)
69+ // TODO: verify early exit is correct
70+ if len(payload) == 0 {
73+ err = removeBOM(resp)
77+ err = xml.Unmarshal(payload, v)
79+ err = fmt.Errorf("unmarshalling type %T: %s", v, err)
84+// Drain reads the response body to completion then closes it. The bytes read are discarded.
85+func Drain(resp *http.Response) {
86+ if resp != nil && resp.Body != nil {
87+ _, _ = io.Copy(io.Discard, resp.Body)
92+// removeBOM removes any byte-order mark prefix from the payload if present.
93+func removeBOM(resp *http.Response) error {
94+ _, err := exported.Payload(resp, &exported.PayloadOptions{
95+ BytesModifier: func(b []byte) []byte {
97+ return bytes.TrimPrefix(b, []byte("\xef\xbb\xbf"))
106+// DecodeByteArray will base-64 decode the provided string into v.
107+func DecodeByteArray(s string, v *[]byte, format Base64Encoding) error {
108+ return azexported.DecodeByteArray(s, v, format)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_dialer_other.gonew file+15
@@ -0,0 +1,15 @@
3+// Copyright (c) Microsoft Corporation. All rights reserved.
4+// Licensed under the MIT License.
13+func defaultTransportDialContext(dialer *net.Dialer) func(context.Context, string, string) (net.Conn, error) {
14+ return dialer.DialContext
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_dialer_wasm.gonew file+15
@@ -0,0 +1,15 @@
1+//go:build (js && wasm) || wasip1
3+// Copyright (c) Microsoft Corporation. All rights reserved.
4+// Licensed under the MIT License.
13+func defaultTransportDialContext(dialer *net.Dialer) func(context.Context, string, string) (net.Conn, error) {
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/transport_default_http_client.gonew file+48
@@ -0,0 +1,48 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
15+ "golang.org/x/net/http2"
18+var defaultHTTPClient *http.Client
21+ defaultTransport := &http.Transport{
22+ Proxy: http.ProxyFromEnvironment,
23+ DialContext: defaultTransportDialContext(&net.Dialer{
24+ Timeout: 30 * time.Second,
25+ KeepAlive: 30 * time.Second,
27+ ForceAttemptHTTP2: true,
29+ MaxIdleConnsPerHost: 10,
30+ IdleConnTimeout: 90 * time.Second,
31+ TLSHandshakeTimeout: 10 * time.Second,
32+ ExpectContinueTimeout: 1 * time.Second,
33+ TLSClientConfig: &tls.Config{
34+ MinVersion: tls.VersionTLS12,
35+ Renegotiation: tls.RenegotiateFreelyAsClient,
38+ // TODO: evaluate removing this once https://github.com/golang/go/issues/59690 has been fixed
39+ if http2Transport, err := http2.ConfigureTransports(defaultTransport); err == nil {
40+ // if the connection has been idle for 10 seconds, send a ping frame for a health check
41+ http2Transport.ReadIdleTimeout = 10 * time.Second
42+ // if there's no response to the ping within the timeout, the connection will be closed
43+ http2Transport.PingTimeout = 5 * time.Second
45+ defaultHTTPClient = &http.Client{
46+ Transport: defaultTransport,
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/doc.gonew file+9
@@ -0,0 +1,9 @@
4+// Copyright 2017 Microsoft Corporation. All rights reserved.
5+// Use of this source code is governed by an MIT
6+// license that can be found in the LICENSE file.
8+// Package streaming contains helpers for streaming IO operations and progress reporting.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming/progress.gonew file+89
@@ -0,0 +1,89 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
12+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported"
15+type progress struct {
17+ rsc io.ReadSeekCloser
18+ pr func(bytesTransferred int64)
22+// NopCloser returns a ReadSeekCloser with a no-op close method wrapping the provided io.ReadSeeker.
23+// In addition to adding a Close method to an io.ReadSeeker, this can also be used to wrap an
24+// io.ReadSeekCloser with a no-op Close method to allow explicit control of when the io.ReedSeekCloser
25+// has its underlying stream closed.
26+func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser {
27+ return exported.NopCloser(rs)
30+// NewRequestProgress adds progress reporting to an HTTP request's body stream.
31+func NewRequestProgress(body io.ReadSeekCloser, pr func(bytesTransferred int64)) io.ReadSeekCloser {
40+// NewResponseProgress adds progress reporting to an HTTP response's body stream.
41+func NewResponseProgress(body io.ReadCloser, pr func(bytesTransferred int64)) io.ReadCloser {
50+// Read reads a block of data from an inner stream and reports progress
51+func (p *progress) Read(b []byte) (n int, err error) {
52+ n, err = p.rc.Read(b)
53+ if err != nil && err != io.EOF {
57+ // Invokes the user's callback method to report progress
62+// Seek only expects a zero or from beginning.
63+func (p *progress) Seek(offset int64, whence int) (int64, error) {
64+ // This should only ever be called with offset = 0 and whence = io.SeekStart
65+ n, err := p.rsc.Seek(offset, whence)
72+// requestBodyProgress supports Close but the underlying stream may not; if it does, Close will close it.
73+func (p *progress) Close() error {
77+// MultipartContent contains streaming content used in multipart/form payloads.
78+type MultipartContent struct {
79+ // Body contains the required content body.
80+ Body io.ReadSeekCloser
82+ // ContentType optionally specifies the HTTP Content-Type for this Body.
83+ // The default value is application/octet-stream.
86+ // Filename optionally specifies the filename for this Body.
87+ // The default value is the field name for the multipart/form section.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/constants.gonew file+41
@@ -0,0 +1,41 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
9+// SpanKind represents the role of a Span inside a Trace. Often, this defines how a Span will be processed and visualized by various backends.
13+ // SpanKindInternal indicates the span represents an internal operation within an application.
14+ SpanKindInternal SpanKind = 1
16+ // SpanKindServer indicates the span covers server-side handling of a request.
17+ SpanKindServer SpanKind = 2
19+ // SpanKindClient indicates the span describes a request to a remote service.
20+ SpanKindClient SpanKind = 3
22+ // SpanKindProducer indicates the span was created by a messaging producer.
23+ SpanKindProducer SpanKind = 4
25+ // SpanKindConsumer indicates the span was created by a messaging consumer.
26+ SpanKindConsumer SpanKind = 5
29+// SpanStatus represents the status of a span.
33+ // SpanStatusUnset is the default status code.
34+ SpanStatusUnset SpanStatus = 0
36+ // SpanStatusError indicates the operation contains an error.
37+ SpanStatusError SpanStatus = 1
39+ // SpanStatusOK indicates the operation completed successfully.
40+ SpanStatusOK SpanStatus = 2
vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing/tracing.gonew file+191
@@ -0,0 +1,191 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
7+// Package tracing contains the definitions needed to support distributed tracing.
14+// ProviderOptions contains the optional values when creating a Provider.
15+type ProviderOptions struct {
16+ // for future expansion
19+// NewProvider creates a new Provider with the specified values.
20+// - newTracerFn is the underlying implementation for creating Tracer instances
21+// - options contains optional values; pass nil to accept the default value
22+func NewProvider(newTracerFn func(name, version string) Tracer, options *ProviderOptions) Provider {
24+ newTracerFn: newTracerFn,
28+// Provider is the factory that creates Tracer instances.
29+// It defaults to a no-op provider.
30+type Provider struct {
31+ newTracerFn func(name, version string) Tracer
34+// NewTracer creates a new Tracer for the specified module name and version.
35+// - module - the fully qualified name of the module
36+// - version - the version of the module
37+func (p Provider) NewTracer(module, version string) (tracer Tracer) {
38+ if p.newTracerFn != nil {
39+ tracer = p.newTracerFn(module, version)
44+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
46+// TracerOptions contains the optional values when creating a Tracer.
47+type TracerOptions struct {
48+ // SpanFromContext contains the implementation for the Tracer.SpanFromContext method.
49+ SpanFromContext func(context.Context) Span
52+// NewTracer creates a Tracer with the specified values.
53+// - newSpanFn is the underlying implementation for creating Span instances
54+// - options contains optional values; pass nil to accept the default value
55+func NewTracer(newSpanFn func(ctx context.Context, spanName string, options *SpanOptions) (context.Context, Span), options *TracerOptions) Tracer {
57+ options = &TracerOptions{}
60+ newSpanFn: newSpanFn,
61+ spanFromContextFn: options.SpanFromContext,
65+// Tracer is the factory that creates Span instances.
68+ newSpanFn func(ctx context.Context, spanName string, options *SpanOptions) (context.Context, Span)
69+ spanFromContextFn func(ctx context.Context) Span
72+// Start creates a new span and a context.Context that contains it.
73+// - ctx is the parent context for this span. If it contains a Span, the newly created span will be a child of that span, else it will be a root span
74+// - spanName identifies the span within a trace, it's typically the fully qualified API name
75+// - options contains optional values for the span, pass nil to accept any defaults
76+func (t Tracer) Start(ctx context.Context, spanName string, options *SpanOptions) (context.Context, Span) {
77+ if t.newSpanFn != nil {
78+ opts := SpanOptions{}
82+ opts.Attributes = append(opts.Attributes, t.attrs...)
83+ return t.newSpanFn(ctx, spanName, &opts)
88+// SetAttributes sets attrs to be applied to each Span. If a key from attrs
89+// already exists for an attribute of the Span it will be overwritten with
90+// the value contained in attrs.
91+func (t *Tracer) SetAttributes(attrs ...Attribute) {
92+ t.attrs = append(t.attrs, attrs...)
95+// Enabled returns true if this Tracer is capable of creating Spans.
96+func (t Tracer) Enabled() bool {
97+ return t.newSpanFn != nil
100+// SpanFromContext returns the Span associated with the current context.
101+// If the provided context has no Span, false is returned.
102+func (t Tracer) SpanFromContext(ctx context.Context) Span {
103+ if t.spanFromContextFn != nil {
104+ return t.spanFromContextFn(ctx)
109+// SpanOptions contains optional settings for creating a span.
110+type SpanOptions struct {
111+ // Kind indicates the kind of Span.
114+ // Attributes contains key-value pairs of attributes for the span.
115+ Attributes []Attribute
118+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
120+// SpanImpl abstracts the underlying implementation for Span,
121+// allowing it to work with various tracing implementations.
122+// Any zero-values will have their default, no-op behavior.
123+type SpanImpl struct {
124+ // End contains the implementation for the Span.End method.
127+ // SetAttributes contains the implementation for the Span.SetAttributes method.
128+ SetAttributes func(...Attribute)
130+ // AddEvent contains the implementation for the Span.AddEvent method.
131+ AddEvent func(string, ...Attribute)
133+ // SetStatus contains the implementation for the Span.SetStatus method.
134+ SetStatus func(SpanStatus, string)
137+// NewSpan creates a Span with the specified implementation.
138+func NewSpan(impl SpanImpl) Span {
144+// Span is a single unit of a trace. A trace can contain multiple spans.
145+// A zero-value Span provides a no-op implementation.
150+// End terminates the span and MUST be called before the span leaves scope.
151+// Any further updates to the span will be ignored after End is called.
152+func (s Span) End() {
153+ if s.impl.End != nil {
158+// SetAttributes sets the specified attributes on the Span.
159+// Any existing attributes with the same keys will have their values overwritten.
160+func (s Span) SetAttributes(attrs ...Attribute) {
161+ if s.impl.SetAttributes != nil {
162+ s.impl.SetAttributes(attrs...)
166+// AddEvent adds a named event with an optional set of attributes to the span.
167+func (s Span) AddEvent(name string, attrs ...Attribute) {
168+ if s.impl.AddEvent != nil {
169+ s.impl.AddEvent(name, attrs...)
173+// SetStatus sets the status on the span along with a description.
174+func (s Span) SetStatus(code SpanStatus, desc string) {
175+ if s.impl.SetStatus != nil {
176+ s.impl.SetStatus(code, desc)
180+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
182+// Attribute is a key-value pair.
183+type Attribute struct {
184+ // Key is the name of the attribute.
187+ // Value is the attribute's value.
188+ // Types that are natively supported include int64, float64, int, bool, string.
189+ // Any other type will be formatted per rules of fmt.Sprintf("%v").
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/.gitignorenew file+4
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.mdnew file+575
@@ -0,0 +1,575 @@
6+* `AzurePipelinesCredential` authenticates an Azure Pipelines service connection with
7+ workload identity federation
10+> These changes affect only code written against a beta version such as v1.7.0-beta.1
11+* Removed the persistent token caching API. It will return in v1.8.0-beta.1
13+## 1.7.0-beta.1 (2024-06-10)
16+* Restored `AzurePipelinesCredential` and persistent token caching API
19+> These changes affect only code written against a beta version such as v1.6.0-beta.4
20+* Values which `NewAzurePipelinesCredential` read from environment variables in
21+ prior versions are now parameters
22+* Renamed `AzurePipelinesServiceConnectionCredentialOptions` to `AzurePipelinesCredentialOptions`
25+* Managed identity bug fixes
30+* `NewOnBehalfOfCredentialWithClientAssertions` creates an on-behalf-of credential
31+ that authenticates with client assertions such as federated credentials
34+> These changes affect only code written against a beta version such as v1.6.0-beta.4
35+* Removed `AzurePipelinesCredential` and the persistent token caching API.
36+ They will return in v1.7.0-beta.1
39+* Managed identity bug fixes
41+## 1.6.0-beta.4 (2024-05-14)
44+* `AzurePipelinesCredential` authenticates an Azure Pipeline service connection with
45+ workload identity federation
47+## 1.6.0-beta.3 (2024-04-09)
50+* `DefaultAzureCredential` now sends a probe request with no retries for IMDS managed identity
51+ environments to avoid excessive retry delays when the IMDS endpoint is not available. This
52+ should improve credential chain resolution for local development scenarios.
55+* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances
60+* `ManagedIdentityCredential` now specifies resource IDs correctly for Azure Container Instances
63+* Restored v1.4.0 error behavior for empty tenant IDs
64+* Upgraded dependencies
66+## 1.6.0-beta.2 (2024-02-06)
69+> These changes affect only code written against a beta version such as v1.6.0-beta.1
70+* Replaced `ErrAuthenticationRequired` with `AuthenticationRequiredError`, a struct
71+ type that carries the `TokenRequestOptions` passed to the `GetToken` call which
75+* Fixed more cases in which credential chains like `DefaultAzureCredential`
76+ should try their next credential after attempting managed identity
77+ authentication in a Docker Desktop container
80+* `AzureCLICredential` uses the CLI's `expires_on` value for token expiration
82+## 1.6.0-beta.1 (2024-01-17)
85+* Restored persistent token caching API first added in v1.5.0-beta.1
86+* Added `AzureCLICredentialOptions.Subscription`
91+* `InteractiveBrowserCredential` handles `AdditionallyAllowedTenants` correctly
96+> These changes affect only code written against a beta version such as v1.5.0-beta.1
97+* Removed persistent token caching. It will return in v1.6.0-beta.1
100+* Credentials now preserve MSAL headers e.g. X-Client-Sku
103+* Upgraded dependencies
105+## 1.5.0-beta.2 (2023-11-07)
108+* `DefaultAzureCredential` and `ManagedIdentityCredential` support Azure ML managed identity
109+* Added spans for distributed tracing.
111+## 1.5.0-beta.1 (2023-10-10)
114+* Optional persistent token caching for most credentials. Set `TokenCachePersistenceOptions`
115+ on a credential's options to enable and configure this. See the package documentation for
116+ this version and [TOKEN_CACHING.md](https://aka.ms/azsdk/go/identity/caching) for more
118+* `AzureDeveloperCLICredential` authenticates with the Azure Developer CLI (`azd`). This
119+ credential is also part of the `DefaultAzureCredential` authentication flow.
121+## 1.4.0 (2023-10-10)
124+* `ManagedIdentityCredential` will now retry when IMDS responds 410 or 503
126+## 1.4.0-beta.5 (2023-09-12)
129+* Service principal credentials can request CAE tokens
132+> These changes affect only code written against a beta version such as v1.4.0-beta.4
133+* Whether `GetToken` requests a CAE token is now determined by `TokenRequestOptions.EnableCAE`. Azure
134+ SDK clients which support CAE will set this option automatically. Credentials no longer request CAE
135+ tokens by default or observe the environment variable "AZURE_IDENTITY_DISABLE_CP1".
138+* Credential chains such as `DefaultAzureCredential` now try their next credential, if any, when
139+ managed identity authentication fails in a Docker Desktop container
140+ ([#21417](https://github.com/Azure/azure-sdk-for-go/issues/21417))
142+## 1.4.0-beta.4 (2023-08-16)
145+* Upgraded dependencies
147+## 1.3.1 (2023-08-16)
150+* Upgraded dependencies
152+## 1.4.0-beta.3 (2023-08-08)
155+* One invocation of `AzureCLICredential.GetToken()` and `OnBehalfOfCredential.GetToken()`
156+ can no longer make two authentication attempts
158+## 1.4.0-beta.2 (2023-07-14)
161+* `DefaultAzureCredentialOptions.TenantID` applies to workload identity authentication
162+* Upgraded dependencies
164+## 1.4.0-beta.1 (2023-06-06)
167+* Re-enabled CAE support as in v1.3.0-beta.3
169+## 1.3.0 (2023-05-09)
172+> These changes affect only code written against a beta version such as v1.3.0-beta.5
173+* Renamed `NewOnBehalfOfCredentialFromCertificate` to `NewOnBehalfOfCredentialWithCertificate`
174+* Renamed `NewOnBehalfOfCredentialFromSecret` to `NewOnBehalfOfCredentialWithSecret`
177+* Upgraded to MSAL v1.0.0
179+## 1.3.0-beta.5 (2023-04-11)
182+> These changes affect only code written against a beta version such as v1.3.0-beta.4
183+* Moved `NewWorkloadIdentityCredential()` parameters into `WorkloadIdentityCredentialOptions`.
184+ The constructor now reads default configuration from environment variables set by the Azure
185+ workload identity webhook by default.
186+ ([#20478](https://github.com/Azure/azure-sdk-for-go/pull/20478))
187+* Removed CAE support. It will return in v1.4.0-beta.1
188+ ([#20479](https://github.com/Azure/azure-sdk-for-go/pull/20479))
191+* Fixed an issue in `DefaultAzureCredential` that could cause the managed identity endpoint check to fail in rare circumstances.
193+## 1.3.0-beta.4 (2023-03-08)
196+* Added `WorkloadIdentityCredentialOptions.AdditionallyAllowedTenants` and `.DisableInstanceDiscovery`
199+* Credentials now synchronize within `GetToken()` so a single instance can be shared among goroutines
200+ ([#20044](https://github.com/Azure/azure-sdk-for-go/issues/20044))
203+* Upgraded dependencies
205+## 1.2.2 (2023-03-07)
208+* Upgraded dependencies
210+## 1.3.0-beta.3 (2023-02-07)
213+* By default, credentials set client capability "CP1" to enable support for
214+ [Continuous Access Evaluation (CAE)](https://learn.microsoft.com/entra/identity-platform/app-resilience-continuous-access-evaluation).
215+ This indicates to Microsoft Entra ID that your application can handle CAE claims challenges.
216+ You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true".
217+* `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login
218+ prompt with a username ([#15599](https://github.com/Azure/azure-sdk-for-go/pull/15599))
219+* Service principal and user credentials support ADFS authentication on Azure Stack.
220+ Specify "adfs" as the credential's tenant.
221+* Applications running in private or disconnected clouds can prevent credentials from
222+ requesting Microsoft Entra instance metadata by setting the `DisableInstanceDiscovery`
223+ field on credential options.
224+* Many credentials can now be configured to authenticate in multiple tenants. The
225+ options types for these credentials have an `AdditionallyAllowedTenants` field
226+ that specifies additional tenants in which the credential may authenticate.
228+## 1.3.0-beta.2 (2023-01-10)
231+* Added `OnBehalfOfCredential` to support the on-behalf-of flow
232+ ([#16642](https://github.com/Azure/azure-sdk-for-go/issues/16642))
235+* `AzureCLICredential` reports token expiration in local time (should be UTC)
238+* `AzureCLICredential` imposes its default timeout only when the `Context`
239+ passed to `GetToken()` has no deadline
240+* Added `NewCredentialUnavailableError()`. This function constructs an error indicating
241+ a credential can't authenticate and an encompassing `ChainedTokenCredential` should
242+ try its next credential, if any.
244+## 1.3.0-beta.1 (2022-12-13)
247+* `WorkloadIdentityCredential` and `DefaultAzureCredential` support
248+ Workload Identity Federation on Kubernetes. `DefaultAzureCredential`
249+ support requires environment variable configuration as set by the
250+ Workload Identity webhook.
251+ ([#15615](https://github.com/Azure/azure-sdk-for-go/issues/15615))
253+## 1.2.0 (2022-11-08)
256+* This version includes all fixes and features from 1.2.0-beta.*
258+## 1.2.0-beta.3 (2022-10-11)
261+* `ManagedIdentityCredential` caches tokens in memory
264+* `ClientCertificateCredential` sends only the leaf cert for SNI authentication
266+## 1.2.0-beta.2 (2022-08-10)
269+* Added `ClientAssertionCredential` to enable applications to authenticate
270+ with custom client assertions
273+* Updated AuthenticationFailedError with links to TROUBLESHOOTING.md for relevant errors
274+* Upgraded `microsoft-authentication-library-for-go` requirement to v0.6.0
276+## 1.2.0-beta.1 (2022-06-07)
279+* `EnvironmentCredential` reads certificate passwords from `AZURE_CLIENT_CERTIFICATE_PASSWORD`
280+ ([#17099](https://github.com/Azure/azure-sdk-for-go/pull/17099))
282+## 1.1.0 (2022-06-07)
285+* `ClientCertificateCredential` and `ClientSecretCredential` support ESTS-R. First-party
286+ applications can set environment variable `AZURE_REGIONAL_AUTHORITY_NAME` with a
288+ ([#15605](https://github.com/Azure/azure-sdk-for-go/issues/15605))
290+## 1.0.1 (2022-06-07)
293+* Upgrade `microsoft-authentication-library-for-go` requirement to v0.5.1
294+ ([#18176](https://github.com/Azure/azure-sdk-for-go/issues/18176))
296+## 1.0.0 (2022-05-12)
299+* `DefaultAzureCredential` reads environment variable `AZURE_CLIENT_ID` for the
300+ client ID of a user-assigned managed identity
301+ ([#17293](https://github.com/Azure/azure-sdk-for-go/pull/17293))
304+* Removed `AuthorizationCodeCredential`. Use `InteractiveBrowserCredential` instead
305+ to authenticate a user with the authorization code flow.
306+* Instances of `AuthenticationFailedError` are now returned by pointer.
307+* `GetToken()` returns `azcore.AccessToken` by value
310+* `AzureCLICredential` panics after receiving an unexpected error type
311+ ([#17490](https://github.com/Azure/azure-sdk-for-go/issues/17490))
314+* `GetToken()` returns an error when the caller specifies no scope
315+* Updated to the latest versions of `golang.org/x/crypto`, `azcore` and `internal`
317+## 0.14.0 (2022-04-05)
320+* This module now requires Go 1.18
321+* Removed `AuthorityHost`. Credentials are now configured for sovereign or private
322+ clouds with the API in `azcore/cloud`, for example:
325+ opts := azidentity.ClientSecretCredentialOptions{AuthorityHost: azidentity.AzureGovernment}
326+ cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts)
329+ import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
331+ opts := azidentity.ClientSecretCredentialOptions{}
332+ opts.Cloud = cloud.AzureGovernment
333+ cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts)
336+## 0.13.2 (2022-03-08)
339+* Prevented a data race in `DefaultAzureCredential` and `ChainedTokenCredential`
340+ ([#17144](https://github.com/Azure/azure-sdk-for-go/issues/17144))
343+* Upgraded App Service managed identity version from 2017-09-01 to 2019-08-01
344+ ([#17086](https://github.com/Azure/azure-sdk-for-go/pull/17086))
346+## 0.13.1 (2022-02-08)
349+* `EnvironmentCredential` supports certificate SNI authentication when
350+ `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` is "true".
351+ ([#16851](https://github.com/Azure/azure-sdk-for-go/pull/16851))
354+* `ManagedIdentityCredential.GetToken()` now returns an error when configured for
355+ a user assigned identity in Azure Cloud Shell (which doesn't support such identities)
356+ ([#16946](https://github.com/Azure/azure-sdk-for-go/pull/16946))
359+* `NewDefaultAzureCredential()` logs non-fatal errors. These errors are also included in the
360+ error returned by `DefaultAzureCredential.GetToken()` when it's unable to acquire a token
361+ from any source. ([#15923](https://github.com/Azure/azure-sdk-for-go/issues/15923))
363+## 0.13.0 (2022-01-11)
366+* Replaced `AuthenticationFailedError.RawResponse()` with a field having the same name
367+* Unexported `CredentialUnavailableError`
368+* Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`.
369+ * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called.
370+ * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential.
371+ * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`.
372+ * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential.
375+* `ManagedIdentityCredential` no longer probes IMDS before requesting a token
376+ from it. Also, an error response from IMDS no longer disables a credential
377+ instance. Following an error, a credential instance will continue to send
378+ requests to IMDS as necessary.
379+* Adopted MSAL for user and service principal authentication
380+* Updated `azcore` requirement to 0.21.0
382+## 0.12.0 (2021-11-02)
384+* Raised minimum go version to 1.16
385+* Removed `NewAuthenticationPolicy()` from credentials. Clients should instead use azcore's
386+ `runtime.NewBearerTokenPolicy()` to construct a bearer token authorization policy.
387+* The `AuthorityHost` field in credential options structs is now a custom type,
388+ `AuthorityHost`, with underlying type `string`
389+* `NewChainedTokenCredential` has a new signature to accommodate a placeholder
393+ cred, err := NewChainedTokenCredential(credA, credB)
396+ cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil)
398+* Removed `ExcludeAzureCLICredential`, `ExcludeEnvironmentCredential`, and `ExcludeMSICredential`
399+ from `DefaultAzureCredentialOptions`
400+* `NewClientCertificateCredential` requires a `[]*x509.Certificate` and `crypto.PrivateKey` instead of
401+ a path to a certificate file. Added `ParseCertificates` to simplify getting these in common cases:
404+ cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil)
407+ certData, err := os.ReadFile("/cert.pem")
408+ certs, key, err := ParseCertificates(certData, password)
409+ cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
411+* Removed `InteractiveBrowserCredentialOptions.ClientSecret` and `.Port`
412+* Removed `AADAuthenticationFailedError`
413+* Removed `id` parameter of `NewManagedIdentityCredential()`. User assigned identities are now
414+ specified by `ManagedIdentityCredentialOptions.ID`:
417+ cred, err := NewManagedIdentityCredential("client-id", nil)
418+ // or, for a resource ID
419+ opts := &ManagedIdentityCredentialOptions{ID: ResourceID}
420+ cred, err := NewManagedIdentityCredential("/subscriptions/...", opts)
423+ clientID := ClientID("7cf7db0d-...")
424+ opts := &ManagedIdentityCredentialOptions{ID: clientID}
425+ // or, for a resource ID
426+ resID: ResourceID("/subscriptions/...")
427+ opts := &ManagedIdentityCredentialOptions{ID: resID}
428+ cred, err := NewManagedIdentityCredential(opts)
430+* `DeviceCodeCredentialOptions.UserPrompt` has a new type: `func(context.Context, DeviceCodeMessage) error`
431+* Credential options structs now embed `azcore.ClientOptions`. In addition to changing literal initialization
432+ syntax, this change renames `HTTPClient` fields to `Transport`.
433+* Renamed `LogCredential` to `EventCredential`
434+* `AzureCLICredential` no longer reads the environment variable `AZURE_CLI_PATH`
435+* `NewManagedIdentityCredential` no longer reads environment variables `AZURE_CLIENT_ID` and
436+ `AZURE_RESOURCE_ID`. Use `ManagedIdentityCredentialOptions.ID` instead.
437+* Unexported `AuthenticationFailedError` and `CredentialUnavailableError` structs. In their place are two
438+ interfaces having the same names.
441+* `AzureCLICredential.GetToken` no longer mutates its `opts.Scopes`
444+* Added connection configuration options to `DefaultAzureCredentialOptions`
445+* `AuthenticationFailedError.RawResponse()` returns the HTTP response motivating the error,
449+* `NewDefaultAzureCredential()` returns `*DefaultAzureCredential` instead of `*ChainedTokenCredential`
450+* Added `TenantID` field to `DefaultAzureCredentialOptions` and `AzureCLICredentialOptions`
452+## 0.11.0 (2021-09-08)
454+* Unexported `AzureCLICredentialOptions.TokenProvider` and its type,
455+ `AzureCLITokenProvider`
458+* `ManagedIdentityCredential.GetToken` returns `CredentialUnavailableError`
459+ when IMDS has no assigned identity, signaling `DefaultAzureCredential` to
460+ try other credentials
463+## 0.10.0 (2021-08-30)
465+* Update based on `azcore` refactor [#15383](https://github.com/Azure/azure-sdk-for-go/pull/15383)
467+## 0.9.3 (2021-08-20)
470+* `ManagedIdentityCredential.GetToken` no longer mutates its `opts.Scopes`
473+* Bumps version of `azcore` to `v0.18.1`
476+## 0.9.2 (2021-07-23)
478+* Adding support for Service Fabric environment in `ManagedIdentityCredential`
479+* Adding an option for using a resource ID instead of client ID in `ManagedIdentityCredential`
482+## 0.9.1 (2021-05-24)
484+* Add LICENSE.txt and bump version information
487+## 0.9.0 (2021-05-21)
489+* Add support for authenticating in Azure Stack environments
490+* Enable user assigned identities for the IMDS scenario in `ManagedIdentityCredential`
491+* Add scope to resource conversion in `GetToken()` on `ManagedIdentityCredential`
494+## 0.8.0 (2021-01-20)
496+* Updating documentation
499+## 0.7.1 (2021-01-04)
501+* Adding port option to `InteractiveBrowserCredential`
504+## 0.7.0 (2020-12-11)
506+* Add `redirectURI` parameter back to authentication code flow
509+## 0.6.1 (2020-12-09)
511+* Updating query parameter in `ManagedIdentityCredential` and updating datetime string for parsing managed identity access tokens.
514+## 0.6.0 (2020-11-16)
516+* Remove `RedirectURL` parameter from auth code flow to align with the MSAL implementation which relies on the native client redirect URL.
519+## 0.5.0 (2020-10-30)
521+* Flattening credential options
524+## 0.4.3 (2020-10-21)
526+* Adding Azure Arc support in `ManagedIdentityCredential`
529+## 0.4.2 (2020-10-16)
534+## 0.4.1 (2020-10-16)
536+* Ensure authority hosts are only HTTPs
539+## 0.4.0 (2020-10-16)
541+* Adding options structs for credentials
544+## 0.3.0 (2020-10-09)
546+* Update `DeviceCodeCredential` callback
549+## 0.2.2 (2020-10-09)
551+* Add `AuthorizationCodeCredential`
554+## 0.2.1 (2020-10-06)
556+* Add `InteractiveBrowserCredential`
559+## 0.2.0 (2020-09-11)
561+* Refactor `azidentity` on top of `azcore` refactor
562+* Updated policies to conform to `policy.Policy` interface changes.
563+* Updated non-retriable errors to conform to `azcore.NonRetriableError`.
564+* Fixed calls to `Request.SetBody()` to include content type.
565+* Switched endpoints to string types and removed extra parsing code.
568+## 0.1.1 (2020-09-02)
570+* Add `AzureCLICredential` to `DefaultAzureCredential` chain
573+## 0.1.0 (2020-07-23)
575+* Initial Release. Azure Identity library that provides Microsoft Entra token authentication support for the SDK.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txtnew file+21
@@ -0,0 +1,21 @@
3+Copyright (c) Microsoft Corporation.
5+Permission is hereby granted, free of charge, to any person obtaining a copy
6+of this software and associated documentation files (the "Software"), to deal
7+in the Software without restriction, including without limitation the rights
8+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+copies of the Software, and to permit persons to whom the Software is
10+furnished to do so, subject to the following conditions:
12+The above copyright notice and this permission notice shall be included in all
13+copies or substantial portions of the Software.
15+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.mdnew file+307
@@ -0,0 +1,307 @@
1+# Migrating from autorest/adal to azidentity
3+`azidentity` provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead.
5+This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`.
9+- [Acquire a token](#acquire-a-token)
10+- [Client certificate authentication](#client-certificate-authentication)
11+- [Client secret authentication](#client-secret-authentication)
12+- [Configuration](#configuration)
13+- [Device code authentication](#device-code-authentication)
14+- [Managed identity](#managed-identity)
15+- [Use azidentity credentials with older packages](#use-azidentity-credentials-with-older-packages)
21+Token providers require a token audience (resource identifier) and an instance of `adal.OAuthConfig`, which requires a Microsoft Entra endpoint and tenant:
24+import "github.com/Azure/go-autorest/autorest/adal"
26+oauthCfg, err := adal.NewOAuthConfig("https://login.chinacloudapi.cn", tenantID)
29+spt, err := adal.NewServicePrincipalTokenWithSecret(
30+ *oauthCfg, clientID, "https://management.chinacloudapi.cn/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
36+A credential instance can acquire tokens for any audience. The audience for each token is determined by the client requesting it. Credentials require endpoint configuration only for sovereign or private clouds. The `azcore/cloud` package has predefined configuration for sovereign clouds such as Azure China:
40+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
41+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
44+clientOpts := azcore.ClientOptions{Cloud: cloud.AzureChina}
46+cred, err := azidentity.NewClientSecretCredential(
47+ tenantID, clientID, secret, &azidentity.ClientSecretCredentialOptions{ClientOptions: clientOpts},
52+## Client secret authentication
58+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
59+ "github.com/Azure/go-autorest/autorest"
60+ "github.com/Azure/go-autorest/autorest/adal"
63+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
65+spt, err := adal.NewServicePrincipalTokenWithSecret(
66+ *oauthCfg, clientID, "https://management.azure.com/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
70+client := subscriptions.NewClient()
71+client.Authorizer = autorest.NewBearerAuthorizer(spt)
78+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
79+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
82+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
85+client, err := armsubscriptions.NewClient(cred, nil)
89+## Client certificate authentication
97+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
98+ "github.com/Azure/go-autorest/autorest"
99+ "github.com/Azure/go-autorest/autorest/adal"
101+certData, err := os.ReadFile("./example.pfx")
104+certificate, rsaPrivateKey, err := decodePkcs12(certData, "")
107+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
110+spt, err := adal.NewServicePrincipalTokenFromCertificate(
111+ *oauthConfig, clientID, certificate, rsaPrivateKey, "https://management.azure.com/",
114+client := subscriptions.NewClient()
115+client.Authorizer = autorest.NewBearerAuthorizer(spt)
124+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
125+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
128+certData, err := os.ReadFile("./example.pfx")
131+certs, key, err := azidentity.ParseCertificates(certData, nil)
134+cred, err = azidentity.NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
137+client, err := armsubscriptions.NewClient(cred, nil)
147+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
148+ "github.com/Azure/go-autorest/autorest"
149+ "github.com/Azure/go-autorest/autorest/adal"
152+spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/", nil)
155+client := subscriptions.NewClient()
156+client.Authorizer = autorest.NewBearerAuthorizer(spt)
163+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
164+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
167+cred, err := azidentity.NewManagedIdentityCredential(nil)
170+client, err := armsubscriptions.NewClient(cred, nil)
174+### User-assigned identities
179+import "github.com/Azure/go-autorest/autorest/adal"
181+opts := &adal.ManagedIdentityOptions{ClientID: "..."}
182+spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/")
189+import "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
191+opts := azidentity.ManagedIdentityCredentialOptions{ID: azidentity.ClientID("...")}
192+cred, err := azidentity.NewManagedIdentityCredential(&opts)
196+## Device code authentication
205+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
206+ "github.com/Azure/go-autorest/autorest"
207+ "github.com/Azure/go-autorest/autorest/adal"
210+oauthClient := &http.Client{}
211+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
213+resource := "https://management.azure.com/"
214+deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthCfg, clientID, resource)
217+// display instructions, wait for the user to authenticate
218+fmt.Println(*deviceCode.Message)
219+token, err := adal.WaitForUserCompletion(oauthClient, deviceCode)
222+spt, err := adal.NewServicePrincipalTokenFromManualToken(*oauthCfg, clientID, resource, *token)
225+client := subscriptions.NewClient()
226+client.Authorizer = autorest.NewBearerAuthorizer(spt)
233+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
234+ "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
237+cred, err := azidentity.NewDeviceCodeCredential(nil)
240+client, err := armsubscriptions.NewSubscriptionsClient(cred, nil)
244+`azidentity.DeviceCodeCredential` will guide a user through authentication, printing instructions to the console by default. The user prompt is customizable. For more information, see the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential).
251+import "github.com/Azure/go-autorest/autorest/adal"
253+oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID)
256+spt, err := adal.NewServicePrincipalTokenWithSecret(
257+ *oauthCfg, clientID, "https://vault.azure.net", &adal.ServicePrincipalTokenSecret{ClientSecret: secret},
268+In ordinary usage, application code doesn't need to request tokens from credentials directly. Azure SDK clients handle token acquisition and refreshing internally. However, applications may call `GetToken()` to do so. All credential types have this method.
272+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
273+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
276+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
279+tk, err := cred.GetToken(
280+ context.TODO(), policy.TokenRequestOptions{Scopes: []string{"https://vault.azure.net/.default"}},
287+Note that `azidentity` credentials use the Microsoft Entra endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/permissions-consent-overview).
289+## Use azidentity credentials with older packages
291+The [azidext module](https://pkg.go.dev/github.com/jongio/azidext/go/azidext) provides an adapter for `azidentity` credential types. The adapter enables using the credential types with older Azure SDK clients. For example:
295+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
296+ "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions"
297+ "github.com/jongio/azidext/go/azidext"
300+cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil)
303+client := subscriptions.NewClient()
304+client.Authorizer = azidext.NewTokenCredentialAdapter(cred, []string{"https://management.azure.com//.default"})
307+
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.mdnew file+258
@@ -0,0 +1,258 @@
1+# Azure Identity Client Module for Go
3+The Azure Identity module provides Microsoft Entra ID ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication.
5+[](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity)
6+| [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity/)
7+| [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity)
13+This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management.
15+Install the Azure Identity module:
18+go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity
23+- an [Azure subscription](https://azure.microsoft.com/free/)
26+### Authenticating during local development
28+When debugging and executing code locally, developers typically use their own accounts to authenticate calls to Azure services. The `azidentity` module supports authenticating through developer tools to simplify local development.
30+#### Authenticating via the Azure CLI
32+`DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user
33+signed in to the [Azure CLI](https://learn.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user.
35+When no default browser is available, `az login` will use the device code
36+authentication flow. This can also be selected manually by running `az login --use-device-code`.
38+#### Authenticate via the Azure Developer CLI
40+Developers coding outside of an IDE can also use the [Azure Developer CLI](https://aka.ms/azure-dev) to authenticate. Applications using the `DefaultAzureCredential` or the `AzureDeveloperCLICredential` can use the account logged in to the Azure Developer CLI to authenticate calls in their application when running locally.
42+To authenticate with the Azure Developer CLI, run `azd auth login`. On a system with a default web browser, `azd` will launch the browser to authenticate. On systems without a default web browser, run `azd auth login --use-device-code` to use the device code authentication flow.
48+A credential is a type which contains or can obtain the data needed for a
49+service client to authenticate requests. Service clients across the Azure SDK
50+accept a credential instance when they are constructed, and use that credential
51+to authenticate requests.
53+The `azidentity` module focuses on OAuth authentication with Microsoft Entra ID. It offers a variety of credential types capable of acquiring a Microsoft Entra access token. See [Credential Types](#credential-types "Credential Types") for a list of this module's credential types.
55+### DefaultAzureCredential
57+`DefaultAzureCredential` is appropriate for most apps that will be deployed to Azure. It combines common production credentials with development credentials. It attempts to authenticate via the following mechanisms in this order, stopping when one succeeds:
59+
61+1. **Environment** - `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate.
62+1. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` will authenticate the configured identity.
63+1. **Managed Identity** - If the app is deployed to an Azure host with managed identity enabled, `DefaultAzureCredential` will authenticate with it.
64+1. **Azure CLI** - If a user or service principal has authenticated via the Azure CLI `az login` command, `DefaultAzureCredential` will authenticate that identity.
65+1. **Azure Developer CLI** - If the developer has authenticated via the Azure Developer CLI `azd auth login` command, the `DefaultAzureCredential` will authenticate with that account.
67+> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
71+`DefaultAzureCredential` and `ManagedIdentityCredential` support
72+[managed identity authentication](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview)
73+in any hosting environment which supports managed identities, such as (this list is not exhaustive):
74+* [Azure App Service](https://learn.microsoft.com/azure/app-service/overview-managed-identity)
75+* [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)
76+* [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization)
77+* [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity)
78+* [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)
79+* [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token)
83+- [Authenticate with DefaultAzureCredential](#authenticate-with-defaultazurecredential "Authenticate with DefaultAzureCredential")
84+- [Define a custom authentication flow with ChainedTokenCredential](#define-a-custom-authentication-flow-with-chainedtokencredential "Define a custom authentication flow with ChainedTokenCredential")
85+- [Specify a user-assigned managed identity for DefaultAzureCredential](#specify-a-user-assigned-managed-identity-for-defaultazurecredential)
87+### Authenticate with DefaultAzureCredential
89+This example demonstrates authenticating a client from the `armresources` module with `DefaultAzureCredential`.
92+cred, err := azidentity.NewDefaultAzureCredential(nil)
97+client := armresources.NewResourceGroupsClient("subscription ID", cred, nil)
100+### Specify a user-assigned managed identity for DefaultAzureCredential
102+To configure `DefaultAzureCredential` to authenticate a user-assigned managed identity, set the environment variable `AZURE_CLIENT_ID` to the identity's client ID.
104+### Define a custom authentication flow with `ChainedTokenCredential`
106+`DefaultAzureCredential` is generally the quickest way to get started developing apps for Azure. For more advanced scenarios, `ChainedTokenCredential` links multiple credential instances to be tried sequentially when authenticating. It will try each chained credential in turn until one provides a token or fails to authenticate due to an error.
108+The following example demonstrates creating a credential, which will attempt to authenticate using managed identity. It will fall back to authenticating via the Azure CLI when a managed identity is unavailable.
111+managed, err := azidentity.NewManagedIdentityCredential(nil)
115+azCLI, err := azidentity.NewAzureCLICredential(nil)
119+chain, err := azidentity.NewChainedTokenCredential([]azcore.TokenCredential{managed, azCLI}, nil)
124+client := armresources.NewResourceGroupsClient("subscription ID", chain, nil)
129+### Authenticating Azure Hosted Applications
133+|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps
134+|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials
135+|[EnvironmentCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|Authenticate a service principal or user configured by environment variables
136+|[ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential)|Authenticate the managed identity of an Azure resource
137+|[WorkloadIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#WorkloadIdentityCredential)|Authenticate a workload identity on Kubernetes
139+### Authenticating Service Principals
143+|[AzurePipelinesCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzurePipelinesCredential)|Authenticate an Azure Pipelines [service connection](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml)
144+|[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion
145+|[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate
146+|[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret
148+### Authenticating Users
152+|[InteractiveBrowserCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#InteractiveBrowserCredential)|Interactively authenticate a user with the default web browser
153+|[DeviceCodeCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential)|Interactively authenticate a user on a device with limited UI
154+|[UsernamePasswordCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#UsernamePasswordCredential)|Authenticate a user with a username and password
156+### Authenticating via Development Tools
160+|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI
161+|[`AzureDeveloperCLICredential`](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureDeveloperCLICredential)|Authenticates as the user signed in to the Azure Developer CLI
163+## Environment Variables
165+`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables:
167+#### Service principal with secret
171+|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application
172+|`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant
173+|`AZURE_CLIENT_SECRET`|one of the application's client secrets
175+#### Service principal with certificate
179+|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application
180+|`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant
181+|`AZURE_CLIENT_CERTIFICATE_PATH`|path to a certificate file including private key
182+|`AZURE_CLIENT_CERTIFICATE_PASSWORD`|password of the certificate file, if any
184+#### Username and password
188+|`AZURE_CLIENT_ID`|ID of a Microsoft Entra application
189+|`AZURE_USERNAME`|a username (usually an email address)
190+|`AZURE_PASSWORD`|that user's password
192+Configuration is attempted in the above order. For example, if values for a
193+client secret and certificate are both present, the client secret will be used.
197+Token caching is an `azidentity` feature that allows apps to:
199+* Cache tokens in memory (default) or on disk (opt-in).
200+* Improve resilience and performance.
201+* Reduce the number of requests made to Microsoft Entra ID to obtain access tokens.
203+For more details, see the [token caching documentation](https://aka.ms/azsdk/go/identity/caching).
209+Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot).
211+For more details on handling specific Microsoft Entra errors, see the Microsoft Entra [error code documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes).
215+This module uses the classification-based logging implementation in `azcore`. To enable console logging for all SDK modules, set `AZURE_SDK_GO_LOGGING` to `all`. Use the `azcore/log` package to control log event output or to enable logs for `azidentity` only. For example:
217+import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
219+// print log output to stdout
220+azlog.SetListener(func(event azlog.Event, s string) {
224+// include only azidentity credential logs
225+azlog.SetEvents(azidentity.EventAuthentication)
228+Credentials log basic information only, such as `GetToken` success or failure and errors. These log entries don't contain authentication secrets but may contain sensitive information.
232+Client and management modules listed on the [Azure SDK releases page](https://azure.github.io/azure-sdk/releases/latest/go.html) support authenticating with `azidentity` credential types. You can learn more about using these libraries in their documentation, which is linked from the release page.
236+If you encounter bugs or have suggestions, please
237+[open an issue](https://github.com/Azure/azure-sdk-for-go/issues).
241+This project welcomes contributions and suggestions. Most contributions require
242+you to agree to a Contributor License Agreement (CLA) declaring that you have
243+the right to, and actually do, grant us the rights to use your contribution.
244+For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
246+When you submit a pull request, a CLA-bot will automatically determine whether
247+you need to provide a CLA and decorate the PR appropriately (e.g., label,
248+comment). Simply follow the instructions provided by the bot. You will only
249+need to do this once across all repos using our CLA.
251+This project has adopted the
252+[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
253+For more information, see the
254+[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
255+or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any
256+additional questions or comments.
258+
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MDnew file+71
@@ -0,0 +1,71 @@
1+## Token caching in the Azure Identity client module
3+*Token caching* is a feature provided by the Azure Identity library that allows apps to:
5+- Improve their resilience and performance.
6+- Reduce the number of requests made to Microsoft Entra ID to obtain access tokens.
7+- Reduce the number of times the user is prompted to authenticate.
9+When an app needs to access a protected Azure resource, it typically needs to obtain an access token from Entra ID. Obtaining that token involves sending a request to Entra ID and may also involve prompting the user. Entra ID then validates the credentials provided in the request and issues an access token.
11+Token caching, via the Azure Identity library, allows the app to store this access token [in memory](#in-memory-token-caching), where it's accessible to the current process, or [on disk](#persistent-token-caching) where it can be accessed across application or process invocations. The token can then be retrieved quickly and easily the next time the app needs to access the same resource. The app can avoid making another request to Entra ID, which reduces network traffic and improves resilience. Additionally, in scenarios where the app is authenticating users, token caching also avoids prompting the user each time new tokens are requested.
13+### In-memory token caching
15+*In-memory token caching* is the default option provided by the Azure Identity library. This caching approach allows apps to store access tokens in memory. With in-memory token caching, the library first determines if a valid access token for the requested resource is already stored in memory. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. If a valid token isn't found, the library will automatically acquire a token by sending a request to Entra ID. The in-memory token cache provided by the Azure Identity library is thread-safe.
17+**Note:** When Azure Identity library credentials are used with Azure service libraries (for example, Azure Blob Storage), the in-memory token caching is active in the `Pipeline` layer as well. All `TokenCredential` implementations are supported there, including custom implementations external to the Azure Identity library.
19+#### Caching cannot be disabled
21+As there are many levels of caching, it's not possible disable in-memory caching. However, the in-memory cache may be cleared by creating a new credential instance.
23+### Persistent token caching
25+> Only azidentity v1.5.0-beta versions support persistent token caching
27+*Persistent disk token caching* is an opt-in feature in the Azure Identity library. The feature allows apps to cache access tokens in an encrypted, persistent storage mechanism. As indicated in the following table, the storage mechanism differs across operating systems.
29+| Operating system | Storage mechanism |
30+|------------------|---------------------------------------|
31+| Linux | kernel key retention service (keyctl) |
35+By default the token cache will protect any data which is persisted using the user data protection APIs available on the current platform.
36+However, there are cases where no data protection is available, and applications may choose to allow storing the token cache in an unencrypted state by setting `TokenCachePersistenceOptions.AllowUnencryptedStorage` to `true`. This allows a credential to fall back to unencrypted storage if it can't encrypt the cache. However, we do not recommend using this storage method due to its significantly lower security measures. In addition, tokens are not encrypted solely to the current user, which could potentially allow unauthorized access to the cache by individuals with machine access.
38+With persistent disk token caching enabled, the library first determines if a valid access token for the requested resource is already stored in the persistent cache. If a valid token is found, it's returned to the app without the need to make another request to Entra ID. Additionally, the tokens are preserved across app runs, which:
40+- Makes the app more resilient to failures.
41+- Ensures the app can continue to function during an Entra ID outage or disruption.
42+- Avoids having to prompt users to authenticate each time the process is restarted.
44+>IMPORTANT! The token cache contains sensitive data and **MUST** be protected to prevent compromising accounts. All application decisions regarding the persistence of the token cache must consider that a breach of its content will fully compromise all the accounts it contains.
48+See the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.6.0-beta.2#pkg-overview) for example code demonstrating how to configure persistent caching and access cached data.
50+### Credentials supporting token caching
52+The following table indicates the state of in-memory and persistent caching in each credential type.
54+**Note:** In-memory caching is activated by default. Persistent token caching needs to be enabled as shown in [this example](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity@v1.5.0-beta.1#example-package-PersistentCache).
56+| Credential | In-memory token caching | Persistent token caching |
57+|--------------------------------|---------------------------------------------------------------------|--------------------------|
58+| `AzureCLICredential` | Not Supported | Not Supported |
59+| `AzureDeveloperCLICredential` | Not Supported | Not Supported |
60+| `AzurePipelinesCredential` | Supported | Supported |
61+| `ClientAssertionCredential` | Supported | Supported |
62+| `ClientCertificateCredential` | Supported | Supported |
63+| `ClientSecretCredential` | Supported | Supported |
64+| `DefaultAzureCredential` | Supported if the target credential in the default chain supports it | Not Supported |
65+| `DeviceCodeCredential` | Supported | Supported |
66+| `EnvironmentCredential` | Supported | Not Supported |
67+| `InteractiveBrowserCredential` | Supported | Supported |
68+| `ManagedIdentityCredential` | Supported | Not Supported |
69+| `OnBehalfOfCredential` | Supported | Supported |
70+| `UsernamePasswordCredential` | Supported | Supported |
71+| `WorkloadIdentityCredential` | Supported | Supported |
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.mdnew file+241
@@ -0,0 +1,241 @@
1+# Troubleshoot Azure Identity authentication issues
3+This troubleshooting guide covers failure investigation techniques, common errors for the credential types in the `azidentity` module, and mitigation steps to resolve these errors.
7+- [Handle azidentity errors](#handle-azidentity-errors)
8+ - [Permission issues](#permission-issues)
9+- [Find relevant information in errors](#find-relevant-information-in-errors)
10+- [Enable and configure logging](#enable-and-configure-logging)
11+- [Troubleshoot AzureCLICredential authentication issues](#troubleshoot-azureclicredential-authentication-issues)
12+- [Troubleshoot AzureDeveloperCLICredential authentication issues](#troubleshoot-azuredeveloperclicredential-authentication-issues)
13+- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues)
14+- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues)
15+- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues)
16+- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues)
17+- [Troubleshoot EnvironmentCredential authentication issues](#troubleshoot-environmentcredential-authentication-issues)
18+- [Troubleshoot ManagedIdentityCredential authentication issues](#troubleshoot-managedidentitycredential-authentication-issues)
19+ - [Azure App Service and Azure Functions managed identity](#azure-app-service-and-azure-functions-managed-identity)
20+ - [Azure Kubernetes Service managed identity](#azure-kubernetes-service-managed-identity)
21+ - [Azure Virtual Machine managed identity](#azure-virtual-machine-managed-identity)
22+- [Troubleshoot UsernamePasswordCredential authentication issues](#troubleshoot-usernamepasswordcredential-authentication-issues)
23+- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues)
24+- [Get additional help](#get-additional-help)
26+## Handle azidentity errors
28+Any service client method that makes a request to the service may return an error due to authentication failure. This is because the credential authenticates on the first call to the service and on any subsequent call that needs to refresh an access token. Authentication errors include a description of the failure and possibly an error message from Microsoft Entra ID. Depending on the application, these errors may or may not be recoverable.
32+Service client errors with a status code of 401 or 403 often indicate that authentication succeeded but the caller doesn't have permission to access the specified API. Check the service documentation to determine which RBAC roles are needed for the request, and ensure the authenticated user or service principal has the appropriate role assignments.
34+## Find relevant information in errors
36+Authentication errors can include responses from Microsoft Entra ID and often contain information helpful in diagnosis. Consider the following error message:
39+ClientSecretCredential authentication failed
40+POST https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a615913/oauth2/v2.0/token
41+--------------------------------------------------------------------------------
42+RESPONSE 401 Unauthorized
43+--------------------------------------------------------------------------------
45+ "error": "invalid_client",
46+ "error_description": "AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '86be4c01-505b-45e9-bfc0-9b825fd84'.\r\nTrace ID: 03da4b8e-5ffe-48ca-9754-aff4276f0100\r\nCorrelation ID: 7b12f9bb-2eef-42e3-ad75-eee69ec9088d\r\nTimestamp: 2022-03-02 18:25:26Z",
50+ "timestamp": "2022-03-02 18:25:26Z",
51+ "trace_id": "03da4b8e-5ffe-48ca-9754-aff4276f0100",
52+ "correlation_id": "7b12f9bb-2eef-42e3-ad75-eee69ec9088d",
53+ "error_uri": "https://login.microsoftonline.com/error?code=7000215"
55+--------------------------------------------------------------------------------
58+This error contains several pieces of information:
60+- __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`.
62+- __Microsoft Entra ID Error Code and Message__: The error code and message returned by Microsoft Entra ID. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/reference-error-codes#aadsts-error-codes) has more information on AADSTS error codes.
64+- __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Microsoft Entra failures.
66+### Enable and configure logging
68+`azidentity` provides the same logging capabilities as the rest of the Azure SDK. The simplest way to see the logs to help debug authentication issues is to print credential logs to the console.
70+import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
72+// print log output to stdout
73+azlog.SetListener(func(event azlog.Event, s string) {
77+// include only azidentity credential logs
78+azlog.SetEvents(azidentity.EventAuthentication)
82+## Troubleshoot DefaultAzureCredential authentication issues
84+| Error |Description| Mitigation |
86+|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|<ul><li>[Enable logging](#enable-and-configure-logging) to get further diagnostic information.</li><li>Consult the troubleshooting guide for underlying credential types for more information.</li><ul><li>[EnvironmentCredential](#troubleshoot-environmentcredential-authentication-issues)</li><li>[ManagedIdentityCredential](#troubleshoot-managedidentitycredential-authentication-issues)</li><li>[AzureCLICredential](#troubleshoot-azureclicredential-authentication-issues)</li></ul>|
87+|Error from the client with a status code of 401 or 403|Authentication succeeded but the authorizing Azure service responded with a 401 (Unauthorized), or 403 (Forbidden) status code|<ul><li>[Enable logging](#enable-and-configure-logging) to determine which credential in the chain returned the authenticating token.</li><li>If an unexpected credential is returning a token, check application configuration such as environment variables.</li><li>Ensure the correct role is assigned to the authenticated identity. For example, a service specific role rather than the subscription Owner role.</li></ul>|
88+|"managed identity timed out"|`DefaultAzureCredential` sets a short timeout on its first managed identity authentication attempt to prevent very long timeouts during local development when no managed identity is available. That timeout causes this error in production when an application requests a token before the hosting environment is ready to provide one.|Use [ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential) directly, at least in production. It doesn't set a timeout on its authentication attempts.|
90+## Troubleshoot EnvironmentCredential authentication issues
92+| Error Message |Description| Mitigation |
94+|Missing or incomplete environment variable configuration|A valid combination of environment variables wasn't set|Ensure the appropriate environment variables are set for the intended authentication method as described in the [module documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|
96+<a id="client-secret"></a>
97+## Troubleshoot ClientSecretCredential authentication issues
99+| Error Code | Issue | Mitigation |
101+|AADSTS7000215|An invalid client secret was provided.|Ensure the secret provided to the credential constructor is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
102+|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret are in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).|
103+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).|
105+<a id="client-cert"></a>
106+## Troubleshoot ClientCertificateCredential authentication issues
108+| Error Code | Description | Mitigation |
110+|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the application registration as described in [Microsoft Entra ID documentation](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-1-upload-a-certificate).|
111+|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the client and tenant IDs provided to the credential constructor are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the [Microsoft Entra ID instructions](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).|
113+<a id="username-password"></a>
114+## Troubleshoot UsernamePasswordCredential authentication issues
116+| Error Code | Issue | Mitigation |
118+|AADSTS50126|The provided username or password is invalid.|Ensure the username and password provided to the credential constructor are valid.|
120+<a id="managed-id"></a>
121+## Troubleshoot ManagedIdentityCredential authentication issues
123+`ManagedIdentityCredential` is designed to work on a variety of Azure hosts support managed identity. Configuration and troubleshooting vary from host to host. The below table lists the Azure hosts that can be assigned a managed identity and are supported by `ManagedIdentityCredential`.
125+|Host Environment| | |
127+|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)|
128+|Azure App Service and Azure Functions|[Configuration](https://learn.microsoft.com/azure/app-service/overview-managed-identity)|[Troubleshooting](#azure-app-service-and-azure-functions-managed-identity)|
129+|Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)|
130+|Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)||
131+|Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)||
133+### Azure Virtual Machine managed identity
135+| Error Message |Description| Mitigation |
137+|The requested identity hasn’t been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn’t assigned to the VM.|If using a user assigned identity, ensure the specified ID is correct.<p/><p/>If using a system assigned identity, make sure it has been enabled as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).|
138+|The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|IMDS doesn't support requests via proxy or gateway. Disable proxies or gateways running on the VM for requests to the IMDS endpoint `http://169.254.169.254`|
139+|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|<ul><li>Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).</li><li>Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.</li></ul>|
140+|Multiple attempts failed to obtain a token from the managed identity endpoint.|The credential has exhausted its retries for a token request.|<ul><li>Refer to the error message for more details on specific failures.<li>Ensure the VM is configured for managed identity as described in [managed identity documentation](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).</li><li>Verify the IMDS endpoint is reachable on the VM. See [below](#verify-imds-is-available-on-the-vm) for instructions.</li></ul>|
142+#### Verify IMDS is available on the VM
144+If you have access to the VM, you can use `curl` to verify the managed identity endpoint is available.
147+curl 'http://169.254.169.254/metadata/identity/oauth2/token?resource=https://management.core.windows.net&api-version=2018-02-01' -H "Metadata: true"
150+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
152+### Azure App Service and Azure Functions managed identity
154+| Error Message |Description| Mitigation |
156+|Get "`http://169.254.169.254/...`" i/o timeout|The App Service host hasn't set environment variables for managed identity configuration.|<ul><li>Ensure the App Service is configured for managed identity as described in [App Service documentation](https://learn.microsoft.com/azure/app-service/overview-managed-identity).</li><li>Verify the App Service environment is properly configured and the managed identity endpoint is available. See [below](#verify-the-app-service-managed-identity-endpoint-is-available) for instructions.</li></ul>|
158+#### Verify the App Service managed identity endpoint is available
160+If you can SSH into the App Service, you can verify managed identity is available in the environment. First ensure the environment variables `IDENTITY_ENDPOINT` and `IDENTITY_SECRET` are set. Then you can verify the managed identity endpoint is available using `curl`.
163+curl "$IDENTITY_ENDPOINT?resource=https://management.core.windows.net&api-version=2019-08-01" -H "X-IDENTITY-HEADER: $IDENTITY_HEADER"
166+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
168+### Azure Kubernetes Service managed identity
172+| Error Message |Description| Mitigation |
174+|"no azure identity found for request clientID"|The application attempted to authenticate before an identity was assigned to its pod|Verify the pod is labeled correctly. This also occurs when a correctly labeled pod authenticates before the identity is ready. To prevent initialization races, configure NMI to set the Retry-After header in its responses as described in [Pod Identity documentation](https://azure.github.io/aad-pod-identity/docs/configure/feature_flags/#set-retry-after-header-in-nmi-response).
176+<a id="azure-cli"></a>
177+## Troubleshoot AzureCLICredential authentication issues
179+| Error Message |Description| Mitigation |
181+|Azure CLI not found on path|The Azure CLI isn’t installed or isn't on the application's path.|<ul><li>Ensure the Azure CLI is installed as described in [Azure CLI documentation](https://learn.microsoft.com/cli/azure/install-azure-cli).</li><li>Validate the installation location is in the application's `PATH` environment variable.</li></ul>|
182+|Please run 'az login' to set up account|No account is currently logged into the Azure CLI, or the login has expired.|<ul><li>Run `az login` to log into the Azure CLI. More information about Azure CLI authentication is available in the [Azure CLI documentation](https://learn.microsoft.com/cli/azure/authenticate-azure-cli).</li><li>Verify that the Azure CLI can obtain tokens. See [below](#verify-the-azure-cli-can-obtain-tokens) for instructions.</li></ul>|
184+#### Verify the Azure CLI can obtain tokens
186+You can manually verify that the Azure CLI can authenticate and obtain tokens. First, use the `account` command to verify the logged in account.
192+Once you've verified the Azure CLI is using the correct account, you can validate that it's able to obtain tokens for that account.
195+az account get-access-token --output json --resource https://management.core.windows.net
198+> This command's output will contain an access token and SHOULD NOT BE SHARED, to avoid compromising account security.
201+## Troubleshoot AzureDeveloperCLICredential authentication issues
203+| Error Message |Description| Mitigation |
205+|Azure Developer CLI not found on path|The Azure Developer CLI isn't installed or couldn't be found.|<ul><li>Ensure the Azure Developer CLI is properly installed. See the installation instructions at [Install or update the Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd).</li><li>Validate the installation location has been added to the `PATH` environment variable.</li></ul>|
206+|Please run "azd auth login"|No account is logged into the Azure Developer CLI, or the login has expired.|<ul><li>Log in to the Azure Developer CLI using the `azd login` command.</li><li>Validate that the Azure Developer CLI can obtain tokens. For instructions, see [Verify the Azure Developer CLI can obtain tokens](#verify-the-azure-developer-cli-can-obtain-tokens).</li></ul>|
208+#### Verify the Azure Developer CLI can obtain tokens
210+You can manually verify that the Azure Developer CLI is properly authenticated and can obtain tokens. First, use the `config` command to verify the account that is currently logged in to the Azure Developer CLI.
216+Once you've verified the Azure Developer CLI is using correct account, you can validate that it's able to obtain tokens for this account.
219+azd auth token --output json --scope https://management.core.windows.net/.default
221+>Note that output of this command will contain a valid access token, and SHOULD NOT BE SHARED to avoid compromising account security.
223+<a id="workload"></a>
224+## Troubleshoot `WorkloadIdentityCredential` authentication issues
226+| Error Message |Description| Mitigation |
228+|no client ID/tenant ID/token file specified|Incomplete configuration|In most cases these values are provided via environment variables set by Azure Workload Identity.<ul><li>If your application runs on Azure Kubernetes Servide (AKS) or a cluster that has deployed the Azure Workload Identity admission webhook, check pod labels and service account configuration. See the [AKS documentation](https://learn.microsoft.com/azure/aks/workload-identity-deploy-cluster#disable-workload-identity) and [Azure Workload Identity troubleshooting guide](https://azure.github.io/azure-workload-identity/docs/troubleshooting.html) for more details.<li>If your application isn't running on AKS or your cluster hasn't deployed the Workload Identity admission webhook, set these values in `WorkloadIdentityCredentialOptions`
231+## Troubleshoot AzurePipelinesCredential authentication issues
233+| Error Message |Description| Mitigation |
235+| AADSTS900023: Specified tenant identifier 'some tenant ID' is neither a valid DNS name, nor a valid external domain.|The `tenantID` argument to `NewAzurePipelinesCredential` is incorrect| Verify the tenant ID. It must identify the tenant of the user-assigned managed identity or service principal configured for the service connection.|
236+| No service connection found with identifier |The `serviceConnectionID` argument to `NewAzurePipelinesCredential` is incorrect| Verify the service connection ID. This parameter refers to the `resourceId` of the Azure Service Connection. It can also be found in the query string of the service connection's configuration in Azure DevOps. [Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) has more information about service connections.|
237+|302 (Found) response from OIDC endpoint|The `systemAccessToken` argument to `NewAzurePipelinesCredential` is incorrect|Check pipeline configuration. This value comes from the predefined variable `System.AccessToken` [as described in Azure Pipelines documentation](https://learn.microsoft.com/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken).|
239+## Get additional help
241+Additional information on ways to reach out for support can be found in [SUPPORT.md](https://github.com/Azure/azure-sdk-for-go/blob/main/SUPPORT.md).
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.jsonnew file+6
@@ -0,0 +1,6 @@
2+ "AssetsRepo": "Azure/azure-sdk-assets",
3+ "AssetsRepoPrefixPath": "go",
4+ "TagPrefix": "go/azidentity",
5+ "Tag": "go/azidentity_087379b475"
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/authentication_record.gonew file+95
@@ -0,0 +1,95 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
16+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
19+var supportedAuthRecordVersions = []string{"1.0"}
21+// authenticationRecord is non-secret account information about an authenticated user that user credentials such as
22+// [DeviceCodeCredential] and [InteractiveBrowserCredential] can use to access previously cached authentication
23+// data. Call these credentials' Authenticate method to get an authenticationRecord for a user.
24+type authenticationRecord struct {
25+ // Authority is the URL of the authority that issued the token.
26+ Authority string `json:"authority"`
28+ // ClientID is the ID of the application that authenticated the user.
29+ ClientID string `json:"clientId"`
31+ // HomeAccountID uniquely identifies the account.
32+ HomeAccountID string `json:"homeAccountId"`
34+ // TenantID identifies the tenant in which the user authenticated.
35+ TenantID string `json:"tenantId"`
37+ // Username is the user's preferred username.
38+ Username string `json:"username"`
40+ // Version of the AuthenticationRecord.
41+ Version string `json:"version"`
44+// UnmarshalJSON implements json.Unmarshaler for AuthenticationRecord
45+func (a *authenticationRecord) UnmarshalJSON(b []byte) error {
46+ // Default unmarshaling is fine but we want to return an error if the record's version isn't supported i.e., we
47+ // want to inspect the unmarshalled values before deciding whether to return an error. Unmarshaling a formally
48+ // different type enables this by assigning all the fields without recursing into this method.
49+ type r authenticationRecord
50+ err := json.Unmarshal(b, (*r)(a))
55+ return errors.New("AuthenticationRecord must have a version")
57+ for _, v := range supportedAuthRecordVersions {
62+ return fmt.Errorf("unsupported AuthenticationRecord version %q. This module supports %v", a.Version, supportedAuthRecordVersions)
65+// account returns the AuthenticationRecord as an MSAL Account. The account is zero-valued when the AuthenticationRecord is zero-valued.
66+func (a *authenticationRecord) account() public.Account {
67+ return public.Account{
68+ Environment: a.Authority,
69+ HomeAccountID: a.HomeAccountID,
70+ PreferredUsername: a.Username,
74+func newAuthenticationRecord(ar public.AuthResult) (authenticationRecord, error) {
75+ u, err := url.Parse(ar.IDToken.Issuer)
77+ return authenticationRecord{}, fmt.Errorf("Authenticate expected a URL issuer but got %q", ar.IDToken.Issuer)
79+ tenant := ar.IDToken.TenantID
81+ tenant = strings.Trim(u.Path, "/")
83+ username := ar.IDToken.PreferredUsername
85+ username = ar.IDToken.UPN
87+ return authenticationRecord{
88+ Authority: fmt.Sprintf("%s://%s", u.Scheme, u.Host),
89+ ClientID: ar.IDToken.Audience,
90+ HomeAccountID: ar.Account.HomeAccountID,
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.gonew file+190
@@ -0,0 +1,190 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
19+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
20+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
21+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
22+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming"
23+ "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal"
24+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential"
25+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
29+ azureAdditionallyAllowedTenants = "AZURE_ADDITIONALLY_ALLOWED_TENANTS"
30+ azureAuthorityHost = "AZURE_AUTHORITY_HOST"
31+ azureClientCertificatePassword = "AZURE_CLIENT_CERTIFICATE_PASSWORD"
32+ azureClientCertificatePath = "AZURE_CLIENT_CERTIFICATE_PATH"
33+ azureClientID = "AZURE_CLIENT_ID"
34+ azureClientSecret = "AZURE_CLIENT_SECRET"
35+ azureFederatedTokenFile = "AZURE_FEDERATED_TOKEN_FILE"
36+ azurePassword = "AZURE_PASSWORD"
37+ azureRegionalAuthorityName = "AZURE_REGIONAL_AUTHORITY_NAME"
38+ azureTenantID = "AZURE_TENANT_ID"
39+ azureUsername = "AZURE_USERNAME"
41+ organizationsTenantID = "organizations"
42+ developerSignOnClientID = "04b07795-8ddb-461a-bbee-02f9e1bf7b46"
43+ defaultSuffix = "/.default"
45+ traceNamespace = "Microsoft.Entra"
46+ traceOpGetToken = "GetToken"
47+ traceOpAuthenticate = "Authenticate"
51+ // capability CP1 indicates the client application is capable of handling CAE claims challenges
52+ cp1 = []string{"CP1"}
53+ errInvalidTenantID = errors.New("invalid tenantID. You can locate your tenantID by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names")
56+// tokenCachePersistenceOptions contains options for persistent token caching
57+type tokenCachePersistenceOptions = internal.TokenCachePersistenceOptions
59+// setAuthorityHost initializes the authority host for credentials. Precedence is:
60+// 1. cloud.Configuration.ActiveDirectoryAuthorityHost value set by user
61+// 2. value of AZURE_AUTHORITY_HOST
62+// 3. default: Azure Public Cloud
63+func setAuthorityHost(cc cloud.Configuration) (string, error) {
64+ host := cc.ActiveDirectoryAuthorityHost
66+ if len(cc.Services) > 0 {
67+ return "", errors.New("missing ActiveDirectoryAuthorityHost for specified cloud")
69+ host = cloud.AzurePublic.ActiveDirectoryAuthorityHost
70+ if envAuthorityHost := os.Getenv(azureAuthorityHost); envAuthorityHost != "" {
71+ host = envAuthorityHost
74+ u, err := url.Parse(host)
78+ if u.Scheme != "https" {
79+ return "", errors.New("cannot use an authority host without https")
84+// resolveAdditionalTenants returns a copy of tenants, simplified when tenants contains a wildcard
85+func resolveAdditionalTenants(tenants []string) []string {
86+ if len(tenants) == 0 {
89+ for _, t := range tenants {
90+ // a wildcard makes all other values redundant
95+ cp := make([]string, len(tenants))
100+// resolveTenant returns the correct tenant for a token request
101+func resolveTenant(defaultTenant, specified, credName string, additionalTenants []string) (string, error) {
102+ if specified == "" || specified == defaultTenant {
103+ return defaultTenant, nil
105+ if defaultTenant == "adfs" {
106+ return "", errors.New("ADFS doesn't support tenants")
108+ if !validTenantID(specified) {
109+ return "", errInvalidTenantID
111+ for _, t := range additionalTenants {
112+ if t == "*" || t == specified {
113+ return specified, nil
116+ return "", fmt.Errorf(`%s isn't configured to acquire tokens for tenant %q. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to allow acquiring tokens for any tenant`, credName, specified)
119+func alphanumeric(r rune) bool {
120+ return ('0' <= r && r <= '9') || ('a' <= r && r <= 'z') || ('A' <= r && r <= 'Z')
123+func validTenantID(tenantID string) bool {
124+ if len(tenantID) < 1 {
127+ for _, r := range tenantID {
128+ if !(alphanumeric(r) || r == '.' || r == '-') {
135+func doForClient(client *azcore.Client, r *http.Request) (*http.Response, error) {
136+ req, err := runtime.NewRequest(r.Context(), r.Method, r.URL.String())
140+ if r.Body != nil && r.Body != http.NoBody {
141+ // create a rewindable body from the existing body as required
142+ var body io.ReadSeekCloser
143+ if rsc, ok := r.Body.(io.ReadSeekCloser); ok {
146+ b, err := io.ReadAll(r.Body)
150+ body = streaming.NopCloser(bytes.NewReader(b))
152+ err = req.SetBody(body, r.Header.Get("Content-Type"))
158+ // copy headers to the new request, ignoring any for which the new request has a value
159+ h := req.Raw().Header
160+ for key, vals := range r.Header {
161+ if _, has := h[key]; !has {
162+ for _, val := range vals {
168+ resp, err := client.Pipeline().Do(req)
175+// enables fakes for test scenarios
176+type msalConfidentialClient interface {
177+ AcquireTokenSilent(ctx context.Context, scopes []string, options ...confidential.AcquireSilentOption) (confidential.AuthResult, error)
178+ AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...confidential.AcquireByAuthCodeOption) (confidential.AuthResult, error)
179+ AcquireTokenByCredential(ctx context.Context, scopes []string, options ...confidential.AcquireByCredentialOption) (confidential.AuthResult, error)
180+ AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, options ...confidential.AcquireOnBehalfOfOption) (confidential.AuthResult, error)
183+// enables fakes for test scenarios
184+type msalPublicClient interface {
185+ AcquireTokenSilent(ctx context.Context, scopes []string, options ...public.AcquireSilentOption) (public.AuthResult, error)
186+ AcquireTokenByUsernamePassword(ctx context.Context, scopes []string, username string, password string, options ...public.AcquireByUsernamePasswordOption) (public.AuthResult, error)
187+ AcquireTokenByDeviceCode(ctx context.Context, scopes []string, options ...public.AcquireByDeviceCodeOption) (public.DeviceCode, error)
188+ AcquireTokenByAuthCode(ctx context.Context, code string, redirectURI string, scopes []string, options ...public.AcquireByAuthCodeOption) (public.AuthResult, error)
189+ AcquireTokenInteractive(ctx context.Context, scopes []string, options ...public.AcquireInteractiveOption) (public.AuthResult, error)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.gonew file+190
@@ -0,0 +1,190 @@
4+// Copyright (c) Microsoft Corporation. All rights reserved.
5+// Licensed under the MIT License.
22+ "github.com/Azure/azure-sdk-for-go/sdk/azcore"
23+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
24+ "github.com/Azure/azure-sdk-for-go/sdk/internal/log"
27+const credNameAzureCLI = "AzureCLICredential"
29+type azTokenProvider func(ctx context.Context, scopes []string, tenant, subscription string) ([]byte, error)
31+// AzureCLICredentialOptions contains optional parameters for AzureCLICredential.
32+type AzureCLICredentialOptions struct {
33+ // AdditionallyAllowedTenants specifies tenants for which the credential may acquire tokens, in addition
34+ // to TenantID. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the
35+ // logged in account can access.
36+ AdditionallyAllowedTenants []string
38+ // Subscription is the name or ID of a subscription. Set this to acquire tokens for an account other
39+ // than the Azure CLI's current account.
42+ // TenantID identifies the tenant the credential should authenticate in.
43+ // Defaults to the CLI's default tenant, which is typically the home tenant of the logged in user.
46+ // inDefaultChain is true when the credential is part of DefaultAzureCredential
48+ // tokenProvider is used by tests to fake invoking az
49+ tokenProvider azTokenProvider
52+// init returns an instance of AzureCLICredentialOptions initialized with default values.
53+func (o *AzureCLICredentialOptions) init() {
54+ if o.tokenProvider == nil {
55+ o.tokenProvider = defaultAzTokenProvider
59+// AzureCLICredential authenticates as the identity logged in to the Azure CLI.
60+type AzureCLICredential struct {
62+ opts AzureCLICredentialOptions
65+// NewAzureCLICredential constructs an AzureCLICredential. Pass nil to accept default options.
66+func NewAzureCLICredential(options *AzureCLICredentialOptions) (*AzureCLICredential, error) {
67+ cp := AzureCLICredentialOptions{}
71+ for _, r := range cp.Subscription {
72+ if !(alphanumeric(r) || r == '-' || r == '_' || r == ' ' || r == '.') {
73+ return nil, fmt.Errorf("%s: invalid Subscription %q", credNameAzureCLI, cp.Subscription)
76+ if cp.TenantID != "" && !validTenantID(cp.TenantID) {
77+ return nil, errInvalidTenantID
80+ cp.AdditionallyAllowedTenants = resolveAdditionalTenants(cp.AdditionallyAllowedTenants)
81+ return &AzureCLICredential{mu: &sync.Mutex{}, opts: cp}, nil
84+// GetToken requests a token from the Azure CLI. This credential doesn't cache tokens, so every call invokes the CLI.
85+// This method is called automatically by Azure SDK clients.
86+func (c *AzureCLICredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) {
87+ at := azcore.AccessToken{}
88+ if len(opts.Scopes) != 1 {
89+ return at, errors.New(credNameAzureCLI + ": GetToken() requires exactly one scope")
91+ if !validScope(opts.Scopes[0]) {
92+ return at, fmt.Errorf("%s.GetToken(): invalid scope %q", credNameAzureCLI, opts.Scopes[0])
94+ tenant, err := resolveTenant(c.opts.TenantID, opts.TenantID, credNameAzureCLI, c.opts.AdditionallyAllowedTenants)
100+ b, err := c.opts.tokenProvider(ctx, opts.Scopes, tenant, c.opts.Subscription)
102+ at, err = c.createAccessToken(b)
105+ err = unavailableIfInChain(err, c.opts.inDefaultChain)
108+ msg := fmt.Sprintf("%s.GetToken() acquired a token for scope %q", credNameAzureCLI, strings.Join(opts.Scopes, ", "))
109+ log.Write(EventAuthentication, msg)
113+// defaultAzTokenProvider invokes the Azure CLI to acquire a token. It assumes
114+// callers have verified that all string arguments are safe to pass to the CLI.
115+var defaultAzTokenProvider azTokenProvider = func(ctx context.Context, scopes []string, tenantID, subscription string) ([]byte, error) {
116+ // pass the CLI a Microsoft Entra ID v1 resource because we don't know which CLI version is installed and older ones don't support v2 scopes
117+ resource := strings.TrimSuffix(scopes[0], defaultSuffix)
118+ // set a default timeout for this authentication iff the application hasn't done so already
119+ var cancel context.CancelFunc
120+ if _, hasDeadline := ctx.Deadline(); !hasDeadline {
121+ ctx, cancel = context.WithTimeout(ctx, cliTimeout)
124+ commandLine := "az account get-access-token -o json --resource " + resource
126+ commandLine += " --tenant " + tenantID
128+ if subscription != "" {
129+ // subscription needs quotes because it may contain spaces
130+ commandLine += ` --subscription "` + subscription + `"`
132+ var cliCmd *exec.Cmd
133+ if runtime.GOOS == "windows" {
134+ dir := os.Getenv("SYSTEMROOT")
136+ return nil, newCredentialUnavailableError(credNameAzureCLI, "environment variable 'SYSTEMROOT' has no value")
138+ cliCmd = exec.CommandContext(ctx, "cmd.exe", "/c", commandLine)
141+ cliCmd = exec.CommandContext(ctx, "/bin/sh", "-c", commandLine)
144+ cliCmd.Env = os.Environ()
145+ var stderr bytes.Buffer
146+ cliCmd.Stderr = &stderr
148+ output, err := cliCmd.Output()
150+ msg := stderr.String()
151+ var exErr *exec.ExitError
152+ if errors.As(err, &exErr) && exErr.ExitCode() == 127 || strings.HasPrefix(msg, "'az' is not recognized") {
153+ msg = "Azure CLI not found on path"
158+ return nil, newCredentialUnavailableError(credNameAzureCLI, msg)
164+func (c *AzureCLICredential) createAccessToken(tk []byte) (azcore.AccessToken, error) {
166+ AccessToken string `json:"accessToken"`
167+ Expires_On int64 `json:"expires_on"`
168+ ExpiresOn string `json:"expiresOn"`
170+ err := json.Unmarshal(tk, &t)
172+ return azcore.AccessToken{}, err
175+ exp := time.Unix(t.Expires_On, 0)
176+ if t.Expires_On == 0 {
177+ exp, err = time.ParseInLocation("2006-01-02 15:04:05.999999", t.ExpiresOn, time.Local)
179+ return azcore.AccessToken{}, fmt.Errorf("%s: error parsing token expiration time %q: %v", credNameAzureCLI, t.ExpiresOn, err)
183+ converted := azcore.AccessToken{
184+ Token: t.AccessToken,
185+ ExpiresOn: exp.UTC(),
187+ return converted, nil
190+var _ azcore.TokenCredential = (*AzureCLICredential)(nil)
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_developer_cli_credential.gonew file+169
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_pipelines_credential.gonew file+140
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.gonew file+138
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.ymlnew file+46
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.gonew file+85
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.gonew file+174
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.gonew file+75
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.gonew file+184
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.gonew file+165
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/developer_credential_util.gonew file+38
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.gonew file+138
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.gonew file+167
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.gonew file+170
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work.sumnew file+60
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.gonew file+118
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/exported.gonew file+18
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal/internal.gonew file+31
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.gonew file+14
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.jsonnew file+17
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.gonew file+501
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.gonew file+128
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.gonew file+113
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.gonew file+273
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1new file+112
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1new file+44
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicepnew file+219
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.gonew file+90
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.gonew file+18
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.gonew file+131
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/LICENSE.txtnew file+21
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/diag.gonew file+51
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/diag/doc.gonew file+7
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/doc.gonew file+7
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo/errorinfo.gonew file+46
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/exported/exported.gonew file+129
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/doc.gonew file+7
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.gonew file+104
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/poller/util.gonew file+155
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.gonew file+123
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/doc.gonew file+7
This diff is too big to show here.
vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/uuid/uuid.gonew file+76
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache/cache.gonew file+54
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.gonew file+719
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/error_design.mdnew file+111
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.gonew file+89
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.gonew file+477
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.gonew file+213
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.gonew file+442
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.gonew file+583
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.gonew file+34
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/design.mdnew file+140
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.gonew file+184
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/mapslice.gonew file+333
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/marshal.gonew file+346
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/struct.gonew file+290
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time/time.gonew file+70
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.gonew file+177
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.gonew file+354
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.gonew file+457
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/apptype_string.gonew file+25
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.gonew file+339
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.gonew file+589
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authorizetype_string.gonew file+30
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.gonew file+320
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.gonew file+33
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant/grant.gonew file+17
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/ops.gonew file+56
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/endpointtype_string.gonew file+25
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/mex_document_definitions.gonew file+394
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/saml_assertion_definitions.gonew file+230
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/version_string.gonew file+25
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_endpoint.gonew file+199
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_mex_document.gonew file+159
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/wstrust.gonew file+136
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.gonew file+149
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options/options.gonew file+52
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared/shared.gonew file+72
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.gonew file+8
This diff is too big to show here.
vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.gonew file+756
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/.gitignorenew file+14
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/CONTRIBUTING.mdnew file
No changes to the content.
vendor/github.com/JohannesKaufmann/html-to-markdown/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/README.mdnew file+242
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/SECURITY.mdnew file+6
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/commonmark.gonew file+393
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/escape/escape.gonew file+65
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/from.gonew file+464
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/logo_five_years.pngnew file
Binary file not shown.
vendor/github.com/JohannesKaufmann/html-to-markdown/markdown.gonew file+212
This diff is too big to show here.
vendor/github.com/JohannesKaufmann/html-to-markdown/utils.gonew file+533
This diff is too big to show here.
vendor/github.com/MakeNowJust/heredoc/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/MakeNowJust/heredoc/README.mdnew file+52
This diff is too big to show here.
vendor/github.com/MakeNowJust/heredoc/heredoc.gonew file+105
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/.gitattributesnew file+1
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/.gitignorenew file+16
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/LICENSEnew file+12
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/README.mdnew file+202
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/array.gonew file+124
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/doc.gonew file+123
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/expand.gonew file+70
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/filter.gonew file+163
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/iteration.gonew file+47
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/manipulation.gonew file+679
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/property.gonew file+275
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/query.gonew file+49
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/traversal.gonew file+704
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/type.gonew file+203
This diff is too big to show here.
vendor/github.com/PuerkitoBio/goquery/utilities.gonew file+178
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/.editorconfignew file+17
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/.gitignorenew file+25
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/.golangci.ymlnew file+95
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/.goreleaser.ymlnew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/Bitfilenew file+24
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/COPYINGnew file+19
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/Makefilenew file+23
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/README.mdnew file+297
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/coalesce.gonew file+35
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/colour.gonew file+192
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/delegate.gonew file+152
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/doc.gonew file+7
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/emitters.gonew file+218
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatter.gonew file+43
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/api.gonew file+57
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/html/html.gonew file+623
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/json.gonew file+39
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/svg/font_liberation_mono.gonew file+51
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/svg/svg.gonew file+222
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/tokens.gonew file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/tty_indexed.gonew file+284
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/formatters/tty_truecolour.gonew file+76
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/iterator.gonew file+76
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexer.gonew file+162
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/README.mdnew file+46
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/caddyfile.gonew file+275
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/cl.gonew file+243
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/dns.gonew file+17
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/emacs.gonew file+533
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/abap.xmlnew file+154
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/abnf.xmlnew file+66
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/actionscript.xmlnew file+68
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/actionscript_3.xmlnew file+163
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ada.xmlnew file+321
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/agda.xmlnew file+66
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/al.xmlnew file+75
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/alloy.xmlnew file+58
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/angular2.xmlnew file+108
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/antlr.xmlnew file+317
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/apacheconf.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/apl.xmlnew file+59
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/applescript.xmlnew file+130
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arangodb_aql.xmlnew file+174
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arduino.xmlnew file+309
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/armasm.xmlnew file+126
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/atl.xmlnew file+165
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/autohotkey.xmlnew file+78
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/autoit.xmlnew file+70
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/awk.xmlnew file+95
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ballerina.xmlnew file+97
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bash.xmlnew file+220
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bash_session.xmlnew file+25
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/batchfile.xmlnew file+660
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/beef.xmlnew file+120
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bibtex.xmlnew file+152
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bicep.xmlnew file+84
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/blitzbasic.xmlnew file+141
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bnf.xmlnew file+28
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/bqn.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/brainfuck.xmlnew file+51
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c#.xmlnew file+121
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c++.xmlnew file+331
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/c.xmlnew file+260
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cap_n_proto.xmlnew file+122
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cassandra_cql.xmlnew file+137
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ceylon.xmlnew file+151
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cfengine3.xmlnew file+197
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cfstatement.xmlnew file+92
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/chaiscript.xmlnew file+134
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/chapel.xmlnew file+143
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cheetah.xmlnew file+55
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/clojure.xmlnew file+71
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cmake.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cobol.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/coffeescript.xmlnew file+210
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/common_lisp.xmlnew file+184
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/coq.xmlnew file+136
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/crystal.xmlnew file+762
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/css.xmlnew file+323
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/csv.xmlnew file+53
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cue.xmlnew file+85
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/cython.xmlnew file+372
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/d.xmlnew file+133
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dart.xmlnew file+213
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dax.xmlnew file+39
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/desktop_entry.xmlnew file+17
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/diff.xmlnew file+52
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/django_jinja.xmlnew file+153
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dns.xmlnew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/docker.xmlnew file+57
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dtd.xmlnew file+168
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dylan.xmlnew file+176
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ebnf.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/elixir.xmlnew file+744
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/elm.xmlnew file+119
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/emacslisp.xmlnew file+132
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/erlang.xmlnew file+166
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/factor.xmlnew file+412
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/fennel.xmlnew file+68
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/fish.xmlnew file+159
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/forth.xmlnew file+78
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/fortran.xmlnew file+102
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/fortranfixed.xmlnew file+71
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/fsharp.xmlnew file+245
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gas.xmlnew file+150
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gdscript.xmlnew file+259
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gdscript3.xmlnew file+270
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gherkin.xmlnew file+263
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gleam.xmlnew file+117
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/glsl.xmlnew file+65
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gnuplot.xmlnew file+289
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/go_template.xmlnew file+114
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/graphql.xmlnew file+88
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/groff.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/groovy.xmlnew file+135
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/handlebars.xmlnew file+147
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hare.xmlnew file+98
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/haskell.xmlnew file+275
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hcl.xmlnew file+143
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hexdump.xmlnew file+189
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hlb.xmlnew file+149
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hlsl.xmlnew file+110
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/holyc.xmlnew file+252
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/html.xmlnew file+159
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/hy.xmlnew file+104
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/idris.xmlnew file+216
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/igor.xmlnew file+47
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ini.xmlnew file+45
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/io.xmlnew file+71
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/iscdhcpd.xmlnew file+96
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/j.xmlnew file+157
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/java.xmlnew file+193
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/javascript.xmlnew file+160
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/json.xmlnew file+112
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/jsonata.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/jsonnet.xmlnew file+138
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/julia.xmlnew file+400
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/jungle.xmlnew file+98
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/kotlin.xmlnew file+223
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/lighttpd_configuration_file.xmlnew file+42
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/llvm.xmlnew file+73
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/lua.xmlnew file+158
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/makefile.xmlnew file+131
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mako.xmlnew file+120
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mason.xmlnew file+89
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/materialize_sql_dialect.xmlnew file+155
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mathematica.xmlnew file+60
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/matlab.xmlnew file+114
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mcfunction.xmlnew file+138
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/meson.xmlnew file+85
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/metal.xmlnew file+270
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/minizinc.xmlnew file+82
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mlir.xmlnew file+73
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/modula-2.xmlnew file+245
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/monkeyc.xmlnew file+153
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/morrowindscript.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/myghty.xmlnew file+77
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/mysql.xmlnew file+121
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nasm.xmlnew file+126
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/natural.xmlnew file+143
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ndisasm.xmlnew file+123
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/newspeak.xmlnew file+121
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nginx_configuration_file.xmlnew file+98
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nim.xmlnew file+211
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nix.xmlnew file+258
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nsis.xmlnew file+59
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/objective-c.xmlnew file+510
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/objectpascal.xmlnew file+145
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ocaml.xmlnew file+145
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/octave.xmlnew file+101
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/odin.xmlnew file+113
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/onesenterprise.xmlnew file+92
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/openedge_abl.xmlnew file+101
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/openscad.xmlnew file+96
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/org_mode.xmlnew file+329
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/pacmanconf.xmlnew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/perl.xmlnew file+400
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xmlnew file+212
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/pig.xmlnew file+105
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/pkgconfig.xmlnew file+73
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/pl_pgsql.xmlnew file+119
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/plaintext.xmlnew file+21
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/plutus_core.xmlnew file+105
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/pony.xmlnew file+135
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postgresql_sql_dialect.xmlnew file+155
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postscript.xmlnew file+89
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/povray.xmlnew file+58
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/powerquery.xmlnew file+51
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/powershell.xmlnew file+230
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/prolog.xmlnew file+115
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/promela.xmlnew file+119
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/promql.xmlnew file+123
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/properties.xmlnew file+45
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/protocol_buffer.xmlnew file+118
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/prql.xmlnew file+161
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/psl.xmlnew file+213
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/puppet.xmlnew file+100
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/python.xmlnew file+593
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/python_2.xmlnew file+356
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/qbasic.xmlnew file+173
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/qml.xmlnew file+113
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/r.xmlnew file+128
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/racket.xmlnew file+260
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ragel.xmlnew file+149
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/react.xmlnew file+236
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/reasonml.xmlnew file+147
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/reg.xmlnew file+68
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/rego.xmlnew file+94
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/rexx.xmlnew file+127
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/rpm_spec.xmlnew file+58
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ruby.xmlnew file+724
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/rust.xmlnew file+375
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sas.xmlnew file+191
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sass.xmlnew file+362
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/scala.xmlnew file+274
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/scheme.xmlnew file+106
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/scilab.xmlnew file+98
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/scss.xmlnew file+373
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sed.xmlnew file+28
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sieve.xmlnew file+61
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/smali.xmlnew file+73
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/smalltalk.xmlnew file+294
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/smarty.xmlnew file+79
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/snbt.xmlnew file+58
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/snobol.xmlnew file+95
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/solidity.xmlnew file+279
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sourcepawn.xmlnew file+59
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sparql.xmlnew file+160
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/sql.xmlnew file+90
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/squidconf.xmlnew file+63
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/standard_ml.xmlnew file+548
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/stas.xmlnew file+85
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/stylus.xmlnew file+132
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/swift.xmlnew file+207
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/systemd.xmlnew file+63
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/systemverilog.xmlnew file+181
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tablegen.xmlnew file+69
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tal.xmlnew file+43
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tasm.xmlnew file+135
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tcl.xmlnew file+272
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tcsh.xmlnew file+121
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/termcap.xmlnew file+75
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/terminfo.xmlnew file+84
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/terraform.xmlnew file+140
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tex.xmlnew file+113
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/thrift.xmlnew file+154
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/toml.xmlnew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/tradingview.xmlnew file+81
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/transact-sql.xmlnew file+137
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/turing.xmlnew file+82
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/turtle.xmlnew file+170
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/twig.xmlnew file+155
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/typescript.xmlnew file+295
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/typoscript.xmlnew file+178
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/typoscriptcssdata.xmlnew file+52
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/typoscripthtmldata.xmlnew file+52
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/typst.xmlnew file+108
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ucode.xmlnew file+147
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/v.xmlnew file+355
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/v_shell.xmlnew file+365
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/vala.xmlnew file+72
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/vb_net.xmlnew file+162
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/verilog.xmlnew file+158
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/vhdl.xmlnew file+171
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/vhs.xmlnew file+48
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/viml.xmlnew file+85
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/vue.xmlnew file+307
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/wdte.xmlnew file+43
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/webgpu_shading_language.xmlnew file+142
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/webvtt.xmlnew file+283
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/whiley.xmlnew file+57
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/xml.xmlnew file+95
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/xorg.xmlnew file+35
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yaml.xmlnew file+122
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yang.xmlnew file+99
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/z80_assembly.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/zed.xmlnew file+51
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/embedded/zig.xmlnew file+112
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/genshi.gonew file+118
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/go.gonew file+81
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/haxe.gonew file+647
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/html.gonew file+8
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/http.gonew file+131
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/lexers.gonew file+79
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/markdown.gonew file+46
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/mysql.gonew file+33
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/php.gonew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/raku.gonew file+1721
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/rst.gonew file+89
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/svelte.gonew file+70
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/typoscript.gonew file+85
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/lexers/zed.gonew file+24
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/mutators.gonew file+201
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/pygments-lexers.txtnew file+322
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/quick/quick.gonew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/regexp.gonew file+489
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/registry.gonew file+210
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/remap.gonew file+94
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/renovate.json5new file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/serialise.gonew file+479
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/style.gonew file+481
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/abap.xmlnew file+11
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/algol.xmlnew file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/algol_nu.xmlnew file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/api.gonew file+65
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/arduino.xmlnew file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/autumn.xmlnew file+36
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/average.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/base16-snazzy.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/borland.xmlnew file+26
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/bw.xmlnew file+23
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-frappe.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-latte.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-macchiato.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-mocha.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/colorful.xmlnew file+52
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/compat.gonew file+66
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/doom-one.xmlnew file+51
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/doom-one2.xmlnew file+64
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/dracula.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/emacs.xmlnew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/evergarden.xmlnew file+33
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/friendly.xmlnew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/fruity.xmlnew file+19
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/github-dark.xmlnew file+45
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/github.xmlnew file+39
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/gruvbox-light.xmlnew file+33
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/gruvbox.xmlnew file+33
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/hr_high_contrast.xmlnew file+12
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/hrdark.xmlnew file+10
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/igor.xmlnew file+9
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/lovelace.xmlnew file+53
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/manni.xmlnew file+44
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/modus-operandi.xmlnew file+13
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/modus-vivendi.xmlnew file+13
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/monokai.xmlnew file+29
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/monokailight.xmlnew file+26
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/murphy.xmlnew file+52
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/native.xmlnew file+35
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/nord.xmlnew file+46
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/nordic.xmlnew file+46
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/onedark.xmlnew file+25
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/onesenterprise.xmlnew file+10
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/paraiso-dark.xmlnew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/paraiso-light.xmlnew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/pastie.xmlnew file+45
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/perldoc.xmlnew file+37
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/pygments.xmlnew file+42
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/rainbow_dash.xmlnew file+40
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/rose-pine-dawn.xmlnew file+29
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/rose-pine-moon.xmlnew file+29
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/rose-pine.xmlnew file+29
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/rrt.xmlnew file+13
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/solarized-dark.xmlnew file+39
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/solarized-dark256.xmlnew file+41
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/solarized-light.xmlnew file+17
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/swapoff.xmlnew file+18
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/tango.xmlnew file+72
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/tokyonight-day.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/tokyonight-moon.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/tokyonight-night.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/tokyonight-storm.xmlnew file+83
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/trac.xmlnew file+35
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/vim.xmlnew file+29
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/vs.xmlnew file+16
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/vulcan.xmlnew file+74
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/witchhazel.xmlnew file+31
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/xcode-dark.xmlnew file+31
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/styles/xcode.xmlnew file+22
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/table.pynew file+31
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/tokentype_enumer.gonew file+583
This diff is too big to show here.
vendor/github.com/alecthomas/chroma/v2/types.gonew file+343
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/.travis.ymlnew file+14
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/LICENSEnew file+24
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/README.mdnew file+144
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/parser.gonew file+889
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/pseudo_classes.gonew file+458
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/selector.gonew file+586
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/serialize.gonew file+176
This diff is too big to show here.
vendor/github.com/andybalholm/cascadia/specificity.gonew file+26
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/.gitignorenew file+4
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/.release-please-manifest.jsonnew file+3
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/.stats.ymlnew file+4
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/Brewfilenew file+1
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/CHANGELOG.mdnew file+240
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/CONTRIBUTING.mdnew file+66
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/LICENSEnew file+8
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/README.mdnew file+876
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/SECURITY.mdnew file+27
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/aliases.gonew file+50
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/api.mdnew file+329
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/bedrock/bedrock.gonew file+245
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/beta.gonew file+364
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/betafile.gonew file+270
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/betamessage.gonew file+5823
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/betamessagebatch.gonew file+879
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/betamodel.gonew file+149
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/client.gonew file+126
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/completion.gonew file+194
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/field.gonew file+45
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apierror/apierror.gonew file+50
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiform/encoder.gonew file+465
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiform/form.gonew file+5
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiform/richparam.gonew file+20
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiform/tag.gonew file+51
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/decoder.gonew file+691
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/encoder.gonew file+392
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/enum.gonew file+145
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/field.gonew file+23
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/port.gonew file+120
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/registry.gonew file+51
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/subfield.gonew file+67
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/tag.gonew file+47
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apijson/union.gonew file+202
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiquery/encoder.gonew file+415
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiquery/query.gonew file+55
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiquery/richparam.gonew file+19
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/apiquery/tag.gonew file+44
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/decode.gonew file+1324
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/encode.gonew file+1398
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/fold.gonew file+48
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/indent.gonew file+182
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/scanner.gonew file+610
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/sentinel/null.gonew file+57
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/shims/shims.gonew file+111
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/stream.gonew file+512
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/tables.gonew file+218
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/tags.gonew file+38
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/encoding/json/time.gonew file+61
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/paramutil/field.gonew file+30
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/paramutil/sentinel.gonew file+31
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/paramutil/union.gonew file+48
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/requestconfig/requestconfig.gonew file+629
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/internal/version.gonew file+5
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/message.gonew file+4562
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/messagebatch.gonew file+825
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/model.gonew file+149
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/option/requestoption.gonew file+284
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/jsonl/jsonl.gonew file+57
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/pagination/pagination.gonew file+134
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/param/encoder.gonew file+101
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/param/option.gonew file+121
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/param/param.gonew file+158
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/respjson/respjson.gonew file+88
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/packages/ssestream/ssestream.gonew file+198
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/release-please-config.jsonnew file+67
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/shared/constant/constants.gonew file+304
This diff is too big to show here.
vendor/github.com/anthropics/anthropic-sdk-go/shared/shared.gonew file+334
This diff is too big to show here.
vendor/github.com/atotto/clipboard/.travis.ymlnew file+22
This diff is too big to show here.
vendor/github.com/atotto/clipboard/LICENSEnew file+27
This diff is too big to show here.
vendor/github.com/atotto/clipboard/README.mdnew file+48
This diff is too big to show here.
vendor/github.com/atotto/clipboard/clipboard.gonew file+20
This diff is too big to show here.
vendor/github.com/atotto/clipboard/clipboard_darwin.gonew file+52
This diff is too big to show here.
vendor/github.com/atotto/clipboard/clipboard_plan9.gonew file+42
This diff is too big to show here.
vendor/github.com/atotto/clipboard/clipboard_unix.gonew file+149
This diff is too big to show here.
vendor/github.com/atotto/clipboard/clipboard_windows.gonew file+157
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/NOTICE.txtnew file+3
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/accountid_endpoint_mode.gonew file+18
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/config.gonew file+211
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/context.gonew file+22
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.gonew file+224
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.gonew file+173
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/auto.gonew file+38
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/configuration.gonew file+43
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/defaults.gonew file+50
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/defaults/doc.gonew file+2
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/defaultsmode.gonew file+95
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/doc.gonew file+62
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/endpoints.gonew file+247
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/errors.gonew file+9
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/from_ptr.gonew file+365
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/logging.gonew file+119
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/logging_generate.gonew file+95
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/metadata.gonew file+213
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/middleware.gonew file+168
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname.gonew file+24
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/osname_go115.gonew file+24
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/private/metrics/metrics.gonew file+320
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/recursion_detection.gonew file+94
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id.gonew file+27
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/request_id_retriever.gonew file+53
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.gonew file+305
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/CHANGELOG.mdnew file+114
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/debug.gonew file+144
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/decode.gonew file+218
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/encode.gonew file+167
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/error.gonew file+23
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi/headers.gonew file+24
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi/middleware.gonew file+71
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi/transport.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi/transport_go117.gonew file+12
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/header.gonew file+175
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/header_value.gonew file+521
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/message.gonew file+117
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/array.gonew file+72
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/encoder.gonew file+80
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/map.gonew file+78
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/middleware.gonew file+62
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.gonew file+69
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.gonew file+115
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/restjson/decoder_util.gonew file+85
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/xml/error_utils.gonew file+48
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/none.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_bucket.gonew file+96
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/ratelimit/token_rate_limit.gonew file+83
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/request.gonew file+25
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive.gonew file+156
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_ratelimit.gonew file+158
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/adaptive_token_bucket.gonew file+83
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/doc.gonew file+80
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/errors.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/jitter_backoff.gonew file+49
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/metadata.gonew file+52
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.gonew file+383
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retry.gonew file+90
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.gonew file+222
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/standard.gonew file+269
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/throttle_error.gonew file+60
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retry/timeout_error.gonew file+52
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/retryer.gonew file+127
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/runtime.gonew file+14
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/cache.gonew file+115
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/const.gonew file+40
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/header_rules.gonew file+82
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.gonew file+70
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/hmac.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/host.gonew file+75
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/scope.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/time.gonew file+36
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/util.gonew file+80
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/middleware.gonew file+414
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/presign_middleware.gonew file+127
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/stream.gonew file+86
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/signer/v4/v4.gonew file+559
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/to_ptr.gonew file+297
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.gonew file+310
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/content_type.gonew file+42
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error.gonew file+33
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/response_error_middleware.gonew file+56
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.gonew file+104
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/types.gonew file+42
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/aws/version.gonew file+8
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.mdnew file+678
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/config.gonew file+222
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/defaultsmode.gonew file+47
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/doc.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/env_config.gonew file+856
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/generate.gonew file+4
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/load_options.gonew file+1141
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/local.gonew file+51
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/provider.gonew file+721
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/resolve.gonew file+383
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/resolve_bearer_token.gonew file+122
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.gonew file+566
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.gonew file+1618
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.mdnew file+591
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/doc.gonew file+4
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/doc.gonew file+58
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds/provider.gonew file+229
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/auth.gonew file+48
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/client.gonew file+165
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/endpoints.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client/middleware.gonew file+164
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/provider.gonew file+193
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/doc.gonew file+92
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/processcreds/provider.gonew file+285
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/doc.gonew file+81
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_cached_token.gonew file+233
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_credentials_provider.gonew file+153
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/ssocreds/sso_token_provider.gonew file+147
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/static_provider.gonew file+53
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/assume_role_provider.gonew file+326
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/credentials/stscreds/web_identity_provider.gonew file+169
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.mdnew file+355
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.gonew file+352
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetDynamicData.gonew file+77
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetIAMInfo.gonew file+103
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetInstanceIdentityDocument.gonew file+110
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetMetadata.gonew file+77
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetRegion.gonew file+73
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetToken.gonew file+119
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_op_GetUserData.gonew file+61
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/auth.gonew file+48
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/doc.gonew file+12
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/endpoints.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.gonew file+114
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/request_middleware.gonew file+313
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/token_provider.gonew file+261
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/auth.gonew file+45
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/scheme.gonew file+191
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_adapter.gonew file+43
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/bearer_token_signer_adapter.gonew file+35
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/credentials_adapter.gonew file+46
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/smithy.gonew file+2
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/auth/smithy/v4signer_adapter.gonew file+57
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.mdnew file+320
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/config.gonew file+65
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.gonew file+57
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/context/context.gonew file+52
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/arn.gonew file+94
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/doc.gonew file+3
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/generate.gonew file+7
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/host.gonew file+51
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partition.gonew file+76
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.gonew file+403
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.jsonnew file+220
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/endpoints.gonew file+201
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.mdnew file+294
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/endpoints.gonew file+302
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.mdnew file+271
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/errors.gonew file+22
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini.gonew file+56
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/parse.gonew file+109
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/sections.gonew file+157
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/strings.gonew file+89
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/token.gonew file+32
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/tokenize.gonew file+92
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value.gonew file+93
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/middleware/middleware.gonew file+42
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/rand/rand.gonew file+33
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/interfaces.gonew file+9
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sdk/time.gonew file+74
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sdkio/byte.gonew file+12
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/shareddefaults/shared_config.gonew file+47
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/strings/strings.gonew file+11
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/LICENSEnew file+28
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/docs.gonew file+7
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/sync/singleflight/singleflight.gonew file+210
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/internal/timeconv/duration.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.mdnew file+140
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.gonew file+176
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.gonew file+22
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.mdnew file+346
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/context.gonew file+56
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/doc.gonew file+3
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/middleware.gonew file+110
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.mdnew file+475
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.gonew file+627
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.gonew file+153
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.gonew file+251
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.gonew file+249
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.gonew file+152
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.gonew file+308
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/deserializers.gonew file+1161
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.gonew file+27
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.gonew file+550
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.jsonnew file+35
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.gonew file+566
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.gonew file+227
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.gonew file+284
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/errors.gonew file+115
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.gonew file+63
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sso/validators.gonew file+175
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.mdnew file+469
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.gonew file+627
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.gonew file+225
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.gonew file+256
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.gonew file+186
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.gonew file+176
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.gonew file+302
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.gonew file+2167
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.gonew file+46
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.gonew file+550
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.jsonnew file+35
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.gonew file+566
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.gonew file+227
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.gonew file+487
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.gonew file+428
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.gonew file+9
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.gonew file+184
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.mdnew file+493
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/LICENSE.txtnew file+202
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.gonew file+779
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.gonew file+520
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.gonew file+436
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.gonew file+447
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.gonew file+177
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.gonew file+168
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.gonew file+180
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.gonew file+381
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.gonew file+227
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.gonew file+296
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.gonew file+2516
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.gonew file+1130
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.jsonnew file+41
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.gonew file+512
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.gonew file+227
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.gonew file+862
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.gonew file+248
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.gonew file+144
This diff is too big to show here.
vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.gonew file+305
This diff is too big to show here.
vendor/github.com/aws/smithy-go/.gitignorenew file+29
This diff is too big to show here.
vendor/github.com/aws/smithy-go/.travis.ymlnew file+28
This diff is too big to show here.
vendor/github.com/aws/smithy-go/CHANGELOG.mdnew file+239
This diff is too big to show here.
vendor/github.com/aws/smithy-go/CODE_OF_CONDUCT.mdnew file+4
This diff is too big to show here.
vendor/github.com/aws/smithy-go/CONTRIBUTING.mdnew file+59
This diff is too big to show here.
vendor/github.com/aws/smithy-go/LICENSEnew file+175
This diff is too big to show here.
vendor/github.com/aws/smithy-go/Makefilenew file+102
This diff is too big to show here.
vendor/github.com/aws/smithy-go/NOTICEnew file+1
This diff is too big to show here.
vendor/github.com/aws/smithy-go/README.mdnew file+27
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/auth.gonew file+3
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/bearer/docs.gonew file+3
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/bearer/middleware.gonew file+104
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/bearer/token.gonew file+50
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/bearer/token_cache.gonew file+208
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/identity.gonew file+47
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/option.gonew file+25
This diff is too big to show here.
vendor/github.com/aws/smithy-go/auth/scheme_id.gonew file+20
This diff is too big to show here.
vendor/github.com/aws/smithy-go/context/suppress_expired.gonew file+81
This diff is too big to show here.
vendor/github.com/aws/smithy-go/doc.gonew file+2
This diff is too big to show here.
vendor/github.com/aws/smithy-go/document.gonew file+10
This diff is too big to show here.
vendor/github.com/aws/smithy-go/document/doc.gonew file+12
This diff is too big to show here.
vendor/github.com/aws/smithy-go/document/document.gonew file+153
This diff is too big to show here.
vendor/github.com/aws/smithy-go/document/errors.gonew file+75
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/doc.gonew file+4
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/encoding.gonew file+40
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/httpbinding/encode.gonew file+123
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/httpbinding/header.gonew file+122
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/httpbinding/path_replace.gonew file+108
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/httpbinding/query.gonew file+107
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/httpbinding/uri.gonew file+111
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/array.gonew file+35
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/constants.gonew file+15
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/decoder_util.gonew file+139
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/encoder.gonew file+30
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/escape.gonew file+198
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/object.gonew file+40
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/json/value.gonew file+149
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/array.gonew file+49
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/constants.gonew file+10
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/doc.gonew file+49
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/element.gonew file+91
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/encoder.gonew file+51
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/error_utils.gonew file+51
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/escape.gonew file+137
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/map.gonew file+53
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/value.gonew file+302
This diff is too big to show here.
vendor/github.com/aws/smithy-go/encoding/xml/xml_decoder.gonew file+154
This diff is too big to show here.
vendor/github.com/aws/smithy-go/endpoints/endpoint.gonew file+23
This diff is too big to show here.
vendor/github.com/aws/smithy-go/errors.gonew file+137
This diff is too big to show here.
vendor/github.com/aws/smithy-go/go_module_metadata.gonew file+6
This diff is too big to show here.
vendor/github.com/aws/smithy-go/internal/sync/singleflight/LICENSEnew file+28
This diff is too big to show here.
vendor/github.com/aws/smithy-go/internal/sync/singleflight/docs.gonew file+8
This diff is too big to show here.
vendor/github.com/aws/smithy-go/internal/sync/singleflight/singleflight.gonew file+210
This diff is too big to show here.
vendor/github.com/aws/smithy-go/io/byte.gonew file+12
This diff is too big to show here.
vendor/github.com/aws/smithy-go/io/doc.gonew file+2
This diff is too big to show here.
vendor/github.com/aws/smithy-go/io/reader.gonew file+16
This diff is too big to show here.
vendor/github.com/aws/smithy-go/io/ringbuffer.gonew file+94
This diff is too big to show here.
vendor/github.com/aws/smithy-go/local-mod-replace.shnew file+39
This diff is too big to show here.
vendor/github.com/aws/smithy-go/logging/logger.gonew file+82
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/doc.gonew file+67
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/logging.gonew file+46
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/metadata.gonew file+65
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/middleware.gonew file+71
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/ordered_group.gonew file+268
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/stack.gonew file+209
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/stack_values.gonew file+100
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/step_build.gonew file+211
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/step_deserialize.gonew file+217
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/step_finalize.gonew file+211
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/step_initialize.gonew file+211
This diff is too big to show here.
vendor/github.com/aws/smithy-go/middleware/step_serialize.gonew file+219
This diff is too big to show here.
vendor/github.com/aws/smithy-go/modman.tomlnew file+10
This diff is too big to show here.
vendor/github.com/aws/smithy-go/private/requestcompression/gzip.gonew file+30
This diff is too big to show here.
vendor/github.com/aws/smithy-go/private/requestcompression/middleware_capture_request_compression.gonew file+52
This diff is too big to show here.
vendor/github.com/aws/smithy-go/private/requestcompression/request_compression.gonew file+103
This diff is too big to show here.
vendor/github.com/aws/smithy-go/properties.gonew file+62
This diff is too big to show here.
vendor/github.com/aws/smithy-go/ptr/doc.gonew file+5
This diff is too big to show here.
vendor/github.com/aws/smithy-go/ptr/from_ptr.gonew file+601
This diff is too big to show here.
vendor/github.com/aws/smithy-go/ptr/gen_scalars.gonew file+83
This diff is too big to show here.
vendor/github.com/aws/smithy-go/ptr/to_ptr.gonew file+499
This diff is too big to show here.
vendor/github.com/aws/smithy-go/rand/doc.gonew file+3
This diff is too big to show here.
vendor/github.com/aws/smithy-go/rand/rand.gonew file+31
This diff is too big to show here.
vendor/github.com/aws/smithy-go/rand/uuid.gonew file+87
This diff is too big to show here.
vendor/github.com/aws/smithy-go/time/time.gonew file+134
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/auth.gonew file+21
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/auth_schemes.gonew file+45
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.gonew file+70
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/client.gonew file+120
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/doc.gonew file+5
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/headerlist.gonew file+163
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/host.gonew file+89
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.gonew file+75
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/md5_checksum.gonew file+25
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_close_response_body.gonew file+79
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.gonew file+84
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.gonew file+81
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_headers.gonew file+167
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_http_logging.gonew file+75
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_metadata.gonew file+51
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/middleware_min_proto.gonew file+79
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/properties.gonew file+80
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/request.gonew file+189
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/response.gonew file+34
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/time.gonew file+13
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/url.gonew file+44
This diff is too big to show here.
vendor/github.com/aws/smithy-go/transport/http/user_agent.gonew file+37
This diff is too big to show here.
vendor/github.com/aws/smithy-go/validation.gonew file+140
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-osc52/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-osc52/v2/README.mdnew file+83
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-osc52/v2/osc52.gonew file+305
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/LICENSE-BSDnew file+27
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/LICENSE-MITnew file+21
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/README.mdnew file+142
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/diff.gonew file+177
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/export.gonew file+16
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/common.gonew file+179
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/doc.gonew file+156
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/git.shnew file+33
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/labels.gonew file+55
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/old.gonew file+478
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/lcs/sequence.gonew file+113
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/merge.gonew file+81
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/myers/diff.gonew file+246
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/ndiff.gonew file+99
This diff is too big to show here.
vendor/github.com/aymanbagabas/go-udiff/unified.gonew file+251
This diff is too big to show here.
vendor/github.com/aymerick/douceur/LICENSEnew file+22
This diff is too big to show here.
vendor/github.com/aymerick/douceur/css/declaration.gonew file+60
This diff is too big to show here.
vendor/github.com/aymerick/douceur/css/rule.gonew file+230
This diff is too big to show here.
vendor/github.com/aymerick/douceur/css/stylesheet.gonew file+25
This diff is too big to show here.
vendor/github.com/aymerick/douceur/parser/parser.gonew file+409
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/.codecov.ymlnew file+10
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/.gitignorenew file+32
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/LICENSEnew file+22
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/README.mdnew file+433
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/UPGRADING.mdnew file+63
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/doublestar.gonew file+13
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/glob.gonew file+472
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/globoptions.gonew file+144
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/globwalk.gonew file+414
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/match.gonew file+403
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/utils.gonew file+160
This diff is too big to show here.
vendor/github.com/bmatcuk/doublestar/v4/validate.gonew file+82
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/.gitignorenew file+2
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/Makefilenew file+101
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/README.mdnew file+193
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/adapters.gonew file+102
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/dirent.gonew file+73
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/dirent_portable.gonew file+134
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/dirent_unix.gonew file+146
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/entry_filter_portable.gonew file+37
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/entry_filter_unix.gonew file+59
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/entry_filter_windows.gonew file+156
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/fastwalk.gonew file+697
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/fastwalk_darwin.gonew file+122
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/fastwalk_portable.gonew file+65
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/fastwalk_unix.gonew file+131
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/go.LICENSEnew file+27
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent.gonew file+109
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_aix.gonew file+29
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_dragonfly.gonew file+54
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_freebsd.gonew file+46
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_js.gonew file+27
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_linux.gonew file+50
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_netbsd.gonew file+46
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_openbsd.gonew file+46
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_solaris.gonew file+29
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/doc.gonew file+2
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/endian_big.gonew file+9
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/dirent/endian_little.gonew file+9
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/fmtdirent/fmtdirent_go120.gonew file+31
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/internal/fmtdirent/fmtdirent_go121.gonew file+15
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/zsyscall_darwin.gonew file+93
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_amd64.1_13.snew file+22
This diff is too big to show here.
vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_arm64.1_13.snew file+22
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/cursor/cursor.gonew file+241
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/filepicker/filepicker.gonew file+526
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/filepicker/hidden_unix.gonew file+11
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/filepicker/hidden_windows.gonew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/help/help.gonew file+243
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/internal/memoization/memoization.gonew file+125
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/internal/runeutil/runeutil.gonew file+102
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/key/key.gonew file+140
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/spinner/spinner.gonew file+211
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/textarea/textarea.gonew file+1682
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/textinput/styles.gonew file+96
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/textinput/textinput.gonew file+968
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/viewport/highlight.gonew file+141
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/viewport/keymap.gonew file+58
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbles/v2/viewport/viewport.gonew file+754
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/.gitattributesnew file+1
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/.gitignorenew file+23
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/.golangci.ymlnew file+40
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/.goreleaser.ymlnew file+5
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/README.mdnew file+411
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/Taskfile.yamlnew file+14
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/clipboard.gonew file+69
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/color.gonew file+121
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/commands.gonew file+186
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/cursed_renderer.gonew file+465
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/cursor.gonew file+26
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/environ.gonew file+34
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/exec.gonew file+133
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/focus.gonew file+9
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/input.gonew file+67
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/key.gonew file+371
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/keyboard.gonew file+160
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/logging.gonew file+53
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/mod.gonew file+27
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/mode.gonew file+8
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/mouse.gonew file+144
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/nil_renderer.gonew file+71
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/options.gonew file+302
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/paste.gonew file+13
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/profile.gonew file+15
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/raw.gonew file+37
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/renderer.gonew file+127
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/screen.gonew file+154
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/signals_unix.gonew file+33
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/signals_windows.gonew file+10
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/standard_renderer.gonew file+387
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/tea.gonew file+1483
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/termcap.gonew file+41
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/termios_bsd.gonew file+13
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/termios_other.gonew file+8
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/termios_unix.gonew file+14
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/tty.gonew file+179
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/tty_unix.gonew file+54
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/tty_windows.gonew file+74
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/util.gonew file+8
This diff is too big to show here.
vendor/github.com/charmbracelet/bubbletea/v2/xterm.gonew file+14
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/.golangci.ymlnew file+41
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/.goreleaser.ymlnew file+6
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/README.mdnew file+103
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/doc.gonew file+4
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/env.gonew file+293
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/env_other.gonew file+8
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/env_windows.gonew file+45
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/profile.gonew file+399
This diff is too big to show here.
vendor/github.com/charmbracelet/colorprofile/writer.gonew file+169
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/.gitignorenew file+2
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/.golangci.ymlnew file+40
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/.goreleaser.ymlnew file+5
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/LICENSE.mdnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/README.mdnew file+91
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/Taskfile.ymlnew file+7
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/fang.gonew file+149
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/help.gonew file+340
This diff is too big to show here.
vendor/github.com/charmbracelet/fang/theme.gonew file+182
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/.editorconfignew file+18
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/.gitattributesnew file+2
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/.gitignorenew file+2
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/.golangci.ymlnew file+49
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/.goreleaser.ymlnew file+6
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/CONTRIBUTING.mdnew file+23
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/README.mdnew file+96
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/Taskfile.ymlnew file+25
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/ansi.gonew file+3
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/baseelement.gonew file+157
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/blockelement.gonew file+65
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/blockstack.gonew file+95
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/codeblock.gonew file+150
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/codespan.gonew file+15
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/context.gonew file+38
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/elements.gonew file+479
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/emphasis.gonew file+47
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/heading.gonew file+79
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/image.gonew file+57
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/link.gonew file+112
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/listitem.gonew file+29
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/margin.gonew file+189
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/paragraph.gonew file+62
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/renderer.gonew file+166
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/style.gonew file+252
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/table.gonew file+205
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/table_links.gonew file+234
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/task.gonew file+27
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/ansi/templatehelper.gonew file+86
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/examples.shnew file+19
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/gallery.shnew file+23
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/glamour.gonew file+294
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/internal/autolink/autolink.gonew file+55
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/README.mdnew file+565
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/ascii.jsonnew file+83
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/dark.jsonnew file+191
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/dracula.gonew file+216
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/dracula.jsonnew file+188
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/light.jsonnew file+190
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/notty.jsonnew file+83
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/pink.jsonnew file+90
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/styles.gonew file+680
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/tokyo-night.gonew file+209
This diff is too big to show here.
vendor/github.com/charmbracelet/glamour/v2/styles/tokyo_night.jsonnew file+182
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/.editorconfignew file+18
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/.gitattributesnew file+1
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/.gitignorenew file+2
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/.golangci.ymlnew file+49
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/.goreleaser.ymlnew file+5
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/README.mdnew file+792
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/Taskfile.yamlnew file+19
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/align.gonew file+82
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/ansi_unix.gonew file+9
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/ansi_windows.gonew file+31
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/borders.gonew file+489
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/canvas.gonew file+267
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/color.gonew file+227
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/get.gonew file+571
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/join.gonew file+175
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/lipgloss.gonew file+3
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/position.gonew file+134
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/query.gonew file+89
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/ranges.gonew file+48
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/runes.gonew file+43
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/set.gonew file+795
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/size.gonew file+40
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/style.gonew file+571
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/table/resizing.gonew file+481
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/table/rows.gonew file+130
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/table/table.gonew file+561
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/table/util.gonew file+44
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/terminal.gonew file+114
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/tree/children.gonew file+100
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/tree/enumerator.gonew file+74
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/tree/renderer.gonew file+142
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/tree/tree.gonew file+369
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/unset.gonew file+331
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/whitespace.gonew file+69
This diff is too big to show here.
vendor/github.com/charmbracelet/lipgloss/v2/writer.gonew file+160
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/.gitignorenew file+17
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/.golangci-soft.ymlnew file+40
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/.golangci.ymlnew file+28
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/.goreleaser.ymlnew file+3
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/LICENSEnew file+21
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/README.mdnew file+367
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/context.gonew file+23
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/formatter.gonew file+27
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/json.gonew file+151
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/level.gonew file+65
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/logfmt.gonew file+32
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/logger.gonew file+411
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/logger_121.gonew file+71
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/logger_no121.gonew file+68
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/options.gonew file+61
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/pkg.gonew file+248
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/stdlog.gonew file+67
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/styles.gonew file+83
This diff is too big to show here.
vendor/github.com/charmbracelet/log/v2/text.gonew file+272
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/.gitattributesnew file+1
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/.golangci.ymlnew file+40
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/.goreleaser.ymlnew file+5
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/LICENSEnew file+5
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/README.mdnew file+25
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/TUTORIAL.mdnew file+207
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/border.gonew file+231
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/buffer.gonew file+612
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/cancelreader_other.gonew file+14
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/cancelreader_windows.gonew file+135
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/cell.gonew file+519
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/doc.gonew file+6
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/environ.gonew file+32
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/event.gonew file+479
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/input.gonew file+61
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/key.gonew file+766
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/key_table.go+664
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/mouse.go+86
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/parse.go+1768
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/styled.go+292
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/tabstop.go+142
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal.go+1090
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_other.go+17
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_reader.go+362
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_reader_other.go+18
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_reader_windows.go+660
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_renderer.go+1584
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_renderer_hardscroll.go+275
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_renderer_hashmap.go+294
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_unix.go+72
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/terminal_windows.go+93
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/tty.go+18
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/tty_other.go+14
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/tty_unix.go+28
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/tty_windows.go+27
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/utils.go+15
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/uv.go+52
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/winch.go+29
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/winch_other.go+15
This diff is too big to show here.
vendor/github.com/charmbracelet/ultraviolet/winch_unix.go+86
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/ansi.go+11
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/ascii.go+8
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/background.go+178
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/c0.go+79
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/c1.go+72
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/charset.go+55
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/clipboard.go+75
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/color.go+784
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/ctrl.go+156
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/cursor.go+635
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/cwd.go+26
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/doc.go+7
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/finalterm.go+67
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/focus.go+9
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/graphics.go+237
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/hyperlink.go+28
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/iterm2.go+18
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/keypad.go+28
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/kitty.go+90
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/kitty/decoder.go+85
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/kitty/encoder.go+64
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/kitty/graphics.go+414
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/kitty/options.go+367
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/method.go+172
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/mode.go+778
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/modes.go+65
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/mouse.go+172
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/notification.go+13
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser.go+417
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser/const.go+78
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser/seq.go+136
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser/transition_table.go+273
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser_decode.go+524
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser_handler.go+60
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/parser_sync.go+29
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/passthrough.go+60
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/paste.go+7
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/reset.go+11
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/screen.go+410
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/sgr.go+79
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/status.go+144
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/style.go+673
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/termcap.go+41
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/title.go+48
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/truncate.go+299
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/util.go+106
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/width.go+113
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/winop.go+53
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/wrap.go+474
This diff is too big to show here.
vendor/github.com/charmbracelet/x/ansi/xterm.go+138
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/buffer.go+473
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/cell.go+508
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/errors.go+6
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/geom.go+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/hardscroll.go+273
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/hashmap.go+301
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/link.go+14
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/pen.go+88
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/screen.go+1506
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/sequence.go+131
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/style.go+31
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/tabstop.go+137
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/utils.go+38
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/wrap.go+194
This diff is too big to show here.
vendor/github.com/charmbracelet/x/cellbuf/writer.go+339
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/charmtone/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/charmtone/charmtone.go+362
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/golden/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/golden/golden.go+82
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/slice/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/exp/slice/slice.go+120
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term.go+49
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term_other.go+39
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term_unix.go+96
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term_unix_bsd.go+11
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term_unix_other.go+11
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/term_windows.go+87
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/terminal.go+12
This diff is too big to show here.
vendor/github.com/charmbracelet/x/term/util.go+47
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/bit_bsd.go+7
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/bit_darwin.go+7
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/bit_other.go+7
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/syscalls_bsd.go+11
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/syscalls_darwin.go+10
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/syscalls_linux.go+14
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/termios.go+249
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/termios_bsd.go+13
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/termios_linux.go+13
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/termios_other.go+15
This diff is too big to show here.
vendor/github.com/charmbracelet/x/termios/termios_solaris.go+26
This diff is too big to show here.
vendor/github.com/charmbracelet/x/windows/LICENSE+21
This diff is too big to show here.
vendor/github.com/charmbracelet/x/windows/doc.go+3
This diff is too big to show here.
vendor/github.com/charmbracelet/x/windows/syscall_windows.go+12
This diff is too big to show here.
vendor/github.com/charmbracelet/x/windows/types_windows.go+351
This diff is too big to show here.
vendor/github.com/charmbracelet/x/windows/zsyscall_windows.go+77
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/LICENSE+15
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/bypass.go+145
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/bypasssafe.go+38
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/common.go+341
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/config.go+306
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/doc.go+211
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/dump.go+509
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/format.go+419
This diff is too big to show here.
vendor/github.com/davecgh/go-spew/spew/spew.go+148
This diff is too big to show here.
vendor/github.com/disintegration/gift/.travis.yml+17
This diff is too big to show here.
vendor/github.com/disintegration/gift/LICENSE+21
This diff is too big to show here.
vendor/github.com/disintegration/gift/README.md+251
This diff is too big to show here.
vendor/github.com/disintegration/gift/colors.go+511
This diff is too big to show here.
vendor/github.com/disintegration/gift/convolution.go+578
This diff is too big to show here.
vendor/github.com/disintegration/gift/effects.go+87
This diff is too big to show here.
vendor/github.com/disintegration/gift/gift.go+219
This diff is too big to show here.
vendor/github.com/disintegration/gift/pixels.go+493
This diff is too big to show here.
vendor/github.com/disintegration/gift/rank.go+223
This diff is too big to show here.
vendor/github.com/disintegration/gift/resize.go+462
This diff is too big to show here.
vendor/github.com/disintegration/gift/transform.go+498
This diff is too big to show here.
vendor/github.com/disintegration/gift/utils.go+242
This diff is too big to show here.
vendor/github.com/disintegration/imageorient/LICENSE+21
This diff is too big to show here.
vendor/github.com/disintegration/imageorient/README.md+61
This diff is too big to show here.
vendor/github.com/disintegration/imageorient/imageorient.go+209
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/.gitignore+27
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/.travis.yml+7
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/ATTRIB+133
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/LICENSE+21
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/README.md+174
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/fastclock.go+129
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/match.go+349
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/regexp.go+395
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/replace.go+177
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/runner.go+1613
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/charclass.go+865
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/code.go+274
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/escape.go+94
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/fuzz.go+20
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/parser.go+2262
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/prefix.go+896
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/replacerdata.go+87
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/tree.go+654
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/syntax/writer.go+500
This diff is too big to show here.
vendor/github.com/dlclark/regexp2/testoutput1+7061
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/.travis.yml+21
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/LICENSE+21
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/README.markdown+124
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/big.go+31
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/bigbytes.go+189
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/bytes.go+143
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/comma.go+116
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/commaf.go+41
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/ftoa.go+49
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/humanize.go+8
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/number.go+192
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/ordinals.go+25
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/si.go+127
This diff is too big to show here.
vendor/github.com/dustin/go-humanize/times.go+117
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/.gitignore
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/LICENSE.txt+19
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/Makefile+10
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/README.md+95
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/capture_metrics.go+86
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/docs.go+10
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go+436
This diff is too big to show here.
vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go+278
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/.cirrus.yml+14
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/.gitignore+10
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/.mailmap+2
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/CHANGELOG.md+569
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/CONTRIBUTING.md+144
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/LICENSE+25
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/README.md+184
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/backend_fen.go+484
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/backend_inotify.go+658
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/backend_kqueue.go+733
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/backend_other.go+23
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/backend_windows.go+682
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/fsnotify.go+494
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/darwin.go+39
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_darwin.go+57
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_dragonfly.go+33
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_freebsd.go+42
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_kqueue.go+32
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_linux.go+56
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_netbsd.go+25
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_openbsd.go+28
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_solaris.go+45
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/debug_windows.go+40
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/freebsd.go+31
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/internal.go+2
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/unix.go+31
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/unix2.go+7
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/internal/windows.go+41
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/system_bsd.go+7
This diff is too big to show here.
vendor/github.com/fsnotify/fsnotify/system_darwin.go+8
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/.gitignore+1
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/CHANGELOG.md+82
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/LICENSE+22
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/README.md+41
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/decode.go+254
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/doc.go+6
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/encode.go+322
This diff is too big to show here.
vendor/github.com/go-logfmt/logfmt/jsonstring.go+277
This diff is too big to show here.
vendor/github.com/go-logr/logr/.golangci.yaml+26
This diff is too big to show here.
vendor/github.com/go-logr/logr/CHANGELOG.md+6
This diff is too big to show here.
vendor/github.com/go-logr/logr/CONTRIBUTING.md+17
This diff is too big to show here.
vendor/github.com/go-logr/logr/LICENSE+201
This diff is too big to show here.
vendor/github.com/go-logr/logr/README.md+407
This diff is too big to show here.
vendor/github.com/go-logr/logr/SECURITY.md+18
This diff is too big to show here.
vendor/github.com/go-logr/logr/context.go+33
This diff is too big to show here.
vendor/github.com/go-logr/logr/context_noslog.go+49
This diff is too big to show here.
vendor/github.com/go-logr/logr/context_slog.go+83
This diff is too big to show here.
vendor/github.com/go-logr/logr/discard.go+24
This diff is too big to show here.
vendor/github.com/go-logr/logr/funcr/funcr.go+914
This diff is too big to show here.
vendor/github.com/go-logr/logr/funcr/slogsink.go+105
This diff is too big to show here.
vendor/github.com/go-logr/logr/logr.go+520
This diff is too big to show here.
vendor/github.com/go-logr/logr/sloghandler.go+192
This diff is too big to show here.
vendor/github.com/go-logr/logr/slogr.go+100
This diff is too big to show here.
vendor/github.com/go-logr/logr/slogsink.go+120
This diff is too big to show here.
vendor/github.com/go-logr/stdr/LICENSE+201
This diff is too big to show here.
vendor/github.com/go-logr/stdr/README.md+6
This diff is too big to show here.
vendor/github.com/go-logr/stdr/stdr.go+170
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/.gitignore+4
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/LICENSE+9
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md+195
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/README.md+167
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/SECURITY.md+19
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md+137
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/claims.go+16
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/doc.go+4
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/ecdsa.go+134
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go+69
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/ed25519.go+79
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go+64
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/errors.go+49
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go+47
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go+78
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/hmac.go+104
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/map_claims.go+109
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/none.go+50
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/parser.go+268
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/parser_option.go+128
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/registered_claims.go+63
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/rsa.go+93
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go+135
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go+107
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/signing_method.go+49
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf+1
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/token.go+100
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/token_option.go+5
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/types.go+149
This diff is too big to show here.
vendor/github.com/golang-jwt/jwt/v5/validator.go+316
This diff is too big to show here.
vendor/github.com/google/go-cmp/LICENSE+27
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/compare.go+671
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/export.go+31
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go+18
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go+123
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go+402
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/flags/flags.go+9
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/function/func.go+106
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/value/name.go+164
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go+34
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/internal/value/sort.go+106
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/options.go+562
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/path.go+390
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report.go+54
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_compare.go+433
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_references.go+264
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_reflect.go+414
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_slices.go+614
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_text.go+432
This diff is too big to show here.
vendor/github.com/google/go-cmp/cmp/report_value.go+121
This diff is too big to show here.
vendor/github.com/google/s2a-go/.gitignore+6
This diff is too big to show here.
vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md+93
This diff is too big to show here.
vendor/github.com/google/s2a-go/CONTRIBUTING.md+29
This diff is too big to show here.
vendor/github.com/google/s2a-go/LICENSE.md+202
This diff is too big to show here.
vendor/github.com/google/s2a-go/README.md+14
This diff is too big to show here.
vendor/github.com/google/s2a-go/fallback/s2a_fallback.go+167
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/authinfo/authinfo.go+119
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/handshaker/handshaker.go+438
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/handshaker/service/service.go+66
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go+388
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go+267
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go+1377
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go+174
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go+549
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go+249
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go+2512
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go+160
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aeadcrypter.go+34
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aesgcm.go+70
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/chachapoly.go+67
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/common.go+92
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/halfconn/ciphersuite.go+98
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/halfconn/counter.go+60
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/halfconn/expander.go+59
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/internal/halfconn/halfconn.go+193
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/record.go+729
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/record/ticketsender.go+178
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go+79
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/v2/README.md+1
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/v2/certverifier/certverifier.go+122
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/v2/remotesigner/remotesigner.go+186
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/v2/s2av2.go+379
This diff is too big to show here.
vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go+403
This diff is too big to show here.
vendor/github.com/google/s2a-go/retry/retry.go+144
This diff is too big to show here.
vendor/github.com/google/s2a-go/s2a.go+442
This diff is too big to show here.
vendor/github.com/google/s2a-go/s2a_options.go+235
This diff is too big to show here.
vendor/github.com/google/s2a-go/s2a_utils.go+79
This diff is too big to show here.
vendor/github.com/google/s2a-go/stream/s2a_stream.go+34
This diff is too big to show here.
vendor/github.com/google/uuid/CHANGELOG.md+41
This diff is too big to show here.
vendor/github.com/google/uuid/CONTRIBUTING.md+26
This diff is too big to show here.
vendor/github.com/google/uuid/CONTRIBUTORS+9
This diff is too big to show here.
vendor/github.com/google/uuid/LICENSE+27
This diff is too big to show here.
vendor/github.com/google/uuid/README.md+21
This diff is too big to show here.
vendor/github.com/google/uuid/dce.go+80
This diff is too big to show here.
vendor/github.com/google/uuid/doc.go+12
This diff is too big to show here.
vendor/github.com/google/uuid/hash.go+59
This diff is too big to show here.
vendor/github.com/google/uuid/marshal.go+38
This diff is too big to show here.
vendor/github.com/google/uuid/node.go+90
This diff is too big to show here.
vendor/github.com/google/uuid/node_js.go+12
This diff is too big to show here.
vendor/github.com/google/uuid/node_net.go+33
This diff is too big to show here.
vendor/github.com/google/uuid/null.go+118
This diff is too big to show here.
vendor/github.com/google/uuid/sql.go+59
This diff is too big to show here.
vendor/github.com/google/uuid/time.go+134
This diff is too big to show here.
vendor/github.com/google/uuid/util.go+43
This diff is too big to show here.
vendor/github.com/google/uuid/uuid.go+365
This diff is too big to show here.
vendor/github.com/google/uuid/version1.go+44
This diff is too big to show here.
vendor/github.com/google/uuid/version4.go+76
This diff is too big to show here.
vendor/github.com/google/uuid/version6.go+56
This diff is too big to show here.
vendor/github.com/google/uuid/version7.go+104
This diff is too big to show here.
vendor/github.com/googleapis/enterprise-certificate-proxy/LICENSE+202
This diff is too big to show here.
vendor/github.com/googleapis/enterprise-certificate-proxy/client/client.go+219
This diff is too big to show here.
vendor/github.com/googleapis/enterprise-certificate-proxy/client/util/util.go+100
This diff is too big to show here.
vendor/github.com/googleapis/gax-go/v2/LICENSE+27
This diff is too big to show here.
vendor/github.com/googleapis/gax-go/v2/internallog/internal/internal.go+134
This diff is too big to show here.
vendor/github.com/googleapis/gax-go/v2/internallog/internallog.go+154
This diff is too big to show here.
vendor/github.com/gorilla/css/LICENSE+28
This diff is too big to show here.
vendor/github.com/gorilla/css/scanner/doc.go+33
This diff is too big to show here.
vendor/github.com/gorilla/css/scanner/scanner.go+360
This diff is too big to show here.
vendor/github.com/gorilla/websocket/.gitignore+25
This diff is too big to show here.
vendor/github.com/gorilla/websocket/AUTHORS+9
This diff is too big to show here.
vendor/github.com/gorilla/websocket/LICENSE+22
This diff is too big to show here.
vendor/github.com/gorilla/websocket/README.md+33
This diff is too big to show here.
vendor/github.com/gorilla/websocket/client.go+434
This diff is too big to show here.
vendor/github.com/gorilla/websocket/compression.go+148
This diff is too big to show here.
vendor/github.com/gorilla/websocket/conn.go+1238
This diff is too big to show here.
vendor/github.com/gorilla/websocket/doc.go+227
This diff is too big to show here.
vendor/github.com/gorilla/websocket/join.go+42
This diff is too big to show here.
vendor/github.com/gorilla/websocket/json.go+60
This diff is too big to show here.
vendor/github.com/gorilla/websocket/mask.go+55
This diff is too big to show here.
vendor/github.com/gorilla/websocket/mask_safe.go+16
This diff is too big to show here.
vendor/github.com/gorilla/websocket/prepared.go+102
This diff is too big to show here.
vendor/github.com/gorilla/websocket/proxy.go+77
This diff is too big to show here.
vendor/github.com/gorilla/websocket/server.go+365
This diff is too big to show here.
vendor/github.com/gorilla/websocket/tls_handshake.go+21
This diff is too big to show here.
vendor/github.com/gorilla/websocket/tls_handshake_116.go+21
This diff is too big to show here.
vendor/github.com/gorilla/websocket/util.go+298
This diff is too big to show here.
vendor/github.com/gorilla/websocket/x_net_proxy.go+473
This diff is too big to show here.
vendor/github.com/inconshreveable/mousetrap/LICENSE+201
This diff is too big to show here.
vendor/github.com/inconshreveable/mousetrap/README.md+23
This diff is too big to show here.
vendor/github.com/inconshreveable/mousetrap/trap_others.go+16
This diff is too big to show here.
vendor/github.com/inconshreveable/mousetrap/trap_windows.go+42
This diff is too big to show here.
vendor/github.com/joho/godotenv/.gitignore+1
This diff is too big to show here.
vendor/github.com/joho/godotenv/LICENCE+23
This diff is too big to show here.
vendor/github.com/joho/godotenv/README.md+202
This diff is too big to show here.
vendor/github.com/joho/godotenv/autoload/autoload.go+15
This diff is too big to show here.
vendor/github.com/joho/godotenv/godotenv.go+228
This diff is too big to show here.
vendor/github.com/joho/godotenv/parser.go+271
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/LICENSE+202
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/diff/diff.go+186
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/pretty/.gitignore+5
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/pretty/doc.go+25
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/pretty/public.go+188
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/pretty/reflect.go+241
This diff is too big to show here.
vendor/github.com/kylelemons/godebug/pretty/structure.go+223
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/.gitignore+101
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md+42
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/LICENSE+7
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/README.md+482
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/colorgens.go+55
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/colors.go+979
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go+25
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go+67
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/hsluv-snapshot-rev4.json+1
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/hsluv.go+207
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go+185
This diff is too big to show here.
vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go+25
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/LICENSE+21
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/client.go+434
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/http.go+17
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/inprocess.go+12
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/interface.go+109
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/oauth.go+76
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/sse.go+42
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/stdio.go+43
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/inprocess.go+70
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/interface.go+50
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/oauth.go+650
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/oauth_utils.go+68
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/sse.go+522
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/stdio.go+288
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/client/transport/streamable_http.go+515
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/prompts.go+170
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/resources.go+99
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/tools.go+974
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/typed_tools.go+20
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/types.go+1044
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/mcp/utils.go+798
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/errors.go+34
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/hooks.go+532
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/http_transport_options.go+11
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/request_handler.go+320
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/server.go+1079
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/session.go+380
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/sse.go+736
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/stdio.go+314
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/server/streamable_http.go+653
This diff is too big to show here.
vendor/github.com/mark3labs/mcp-go/util/logger.go+33
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/LICENSE+9
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/README.md+50
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/doc.go+2
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/go.test.sh+12
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_bsd.go+20
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_others.go+17
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_plan9.go+23
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_solaris.go+21
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_tcgets.go+20
This diff is too big to show here.
vendor/github.com/mattn/go-isatty/isatty_windows.go+125
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/LICENSE+21
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/README.md+27
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth.go+358
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth_appengine.go+9
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth_js.go+9
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth_posix.go+81
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth_table.go+450
This diff is too big to show here.
vendor/github.com/mattn/go-runewidth/runewidth_windows.go+28
This diff is too big to show here.
vendor/github.com/mfridman/interpolate/LICENSE.txt+24
This diff is too big to show here.
vendor/github.com/mfridman/interpolate/README.md+85
This diff is too big to show here.
vendor/github.com/mfridman/interpolate/env.go+53
This diff is too big to show here.
vendor/github.com/mfridman/interpolate/interpolate.go+213
This diff is too big to show here.
vendor/github.com/mfridman/interpolate/parser.go+281
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/CONTRIBUTING.md+50
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/CREDITS.md+8
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/LICENSE.md+28
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/README.md+386
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/SECURITY.md+13
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/css/handlers.go+2016
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/doc.go+104
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/helpers.go+300
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/policies.go+253
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/policy.go+990
This diff is too big to show here.
vendor/github.com/microcosm-cc/bluemonday/sanitize.go+1096
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/.gitignore+15
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/.golangci-soft.yml+47
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/.golangci.yml+29
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/README.md+64
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader.go+93
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_bsd.go+146
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_default.go+12
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_linux.go+154
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_select.go+136
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_unix.go+18
This diff is too big to show here.
vendor/github.com/muesli/cancelreader/cancelreader_windows.go+244
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/.gitignore+17
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/.golangci-soft.yml+47
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/.golangci.yml+29
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/README.md+39
This diff is too big to show here.
vendor/github.com/muesli/mango-cobra/mcobra.go+61
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/.gitignore+17
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/.golangci-soft.yml+47
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/.golangci.yml+29
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/README.md+33
This diff is too big to show here.
vendor/github.com/muesli/mango-pflag/mpflag.go+30
This diff is too big to show here.
vendor/github.com/muesli/mango/.gitignore+19
This diff is too big to show here.
vendor/github.com/muesli/mango/.golangci-soft.yml+47
This diff is too big to show here.
vendor/github.com/muesli/mango/.golangci.yml+29
This diff is too big to show here.
vendor/github.com/muesli/mango/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/mango/README.md+150
This diff is too big to show here.
vendor/github.com/muesli/mango/builder.go+21
This diff is too big to show here.
vendor/github.com/muesli/mango/mango.go+221
This diff is too big to show here.
vendor/github.com/muesli/mango/mango.png
This diff is too big to show here.
vendor/github.com/muesli/roff/.gitignore+15
This diff is too big to show here.
vendor/github.com/muesli/roff/.golangci-soft.yml+47
This diff is too big to show here.
vendor/github.com/muesli/roff/.golangci.yml+29
This diff is too big to show here.
vendor/github.com/muesli/roff/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/roff/README.md+65
This diff is too big to show here.
vendor/github.com/muesli/roff/roff.go+163
This diff is too big to show here.
vendor/github.com/muesli/termenv/.gitignore+15
This diff is too big to show here.
vendor/github.com/muesli/termenv/.golangci-soft.yml+43
This diff is too big to show here.
vendor/github.com/muesli/termenv/.golangci.yml+28
This diff is too big to show here.
vendor/github.com/muesli/termenv/LICENSE+21
This diff is too big to show here.
vendor/github.com/muesli/termenv/README.md+431
This diff is too big to show here.
vendor/github.com/muesli/termenv/ansi_compat.md+65
This diff is too big to show here.
vendor/github.com/muesli/termenv/ansicolors.go+281
This diff is too big to show here.
vendor/github.com/muesli/termenv/color.go+205
This diff is too big to show here.
vendor/github.com/muesli/termenv/constants_linux.go+8
This diff is too big to show here.
vendor/github.com/muesli/termenv/constants_solaris.go+8
This diff is too big to show here.
vendor/github.com/muesli/termenv/constants_unix.go+13
This diff is too big to show here.
vendor/github.com/muesli/termenv/constants_zos.go+8
This diff is too big to show here.
vendor/github.com/muesli/termenv/copy.go+37
This diff is too big to show here.
vendor/github.com/muesli/termenv/hyperlink.go+11
This diff is too big to show here.
vendor/github.com/muesli/termenv/notification.go+11
This diff is too big to show here.
vendor/github.com/muesli/termenv/output.go+205
This diff is too big to show here.
vendor/github.com/muesli/termenv/profile.go+112
This diff is too big to show here.
vendor/github.com/muesli/termenv/screen.go+590
This diff is too big to show here.
vendor/github.com/muesli/termenv/style.go+126
This diff is too big to show here.
vendor/github.com/muesli/termenv/templatehelper.go+88
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv.go+115
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv_other.go+30
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv_posix.go+17
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv_solaris.go+22
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv_unix.go+301
This diff is too big to show here.
vendor/github.com/muesli/termenv/termenv_windows.go+140
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/.gitignore+23
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/LICENSE+21
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/README.md+121
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/backup.go+134
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/blob.go+266
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/config.go+397
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/conn.go+496
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/const.go+425
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/context.go+234
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/driver/driver.go+821
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/driver/savepoint.go+40
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/driver/time.go+32
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/driver/util.go+74
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/embed/README.md+41
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/embed/build.sh+33
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/embed/exports.txt+141
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/embed/init.go+21
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/embed/sqlite3.wasm
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/error.go+164
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/func.go+319
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/alloc/alloc_other.go+24
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/alloc/alloc_unix.go+67
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/alloc/alloc_windows.go+74
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go+29
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_other.go+13
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk_unix.go+50
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/const.go+117
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/error.go+116
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/func.go+202
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/handle.go+70
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/json.go+50
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/math.go+29
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/mem.go+153
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap_other.go+5
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap_unix.go+87
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/mmap_windows.go+51
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/module.go+25
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/pointer.go+11
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/reflect.go+10
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/internal/util/set.go+12
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/json.go+12
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/pointer.go+13
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/quote.go+140
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/registry.go+30
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/sqlite.go+344
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/stmt.go+756
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/time.go+357
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/txn.go+301
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/README.md+9
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/arg.go+65
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/const.go+61
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/parse.go+210
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/sql3util.go+9
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/util/sql3util/wasm/sql3parse_table.wasm
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/value.go+241
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/README.md+124
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/api.go+216
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/cksm.go+168
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/const.go+251
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/file.go+247
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/filename.go+179
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/lock.go+128
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/lock_other.go+23
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_bsd.go+110
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_darwin.go+107
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_dotlk.go+143
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_f2fs_linux.go+37
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_linux.go+86
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_ofd.go+59
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_std.go+50
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_std_alloc.go+19
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_std_atomic.go+9
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_std_rw.go+13
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_std_sync.go+9
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_unix.go+103
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/os_windows.go+179
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/registry.go+48
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm.go+26
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_bsd.go+249
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_copy.go+87
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_dotlk.go+178
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_memlk.go+53
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_ofd.go+176
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_other.go+21
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/shm_windows.go+175
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vfs/vfs.go+462
This diff is too big to show here.
vendor/github.com/ncruces/go-sqlite3/vtab.go+689
This diff is too big to show here.
vendor/github.com/ncruces/julianday/.gitignore+15
This diff is too big to show here.
vendor/github.com/ncruces/julianday/LICENSE+21
This diff is too big to show here.
vendor/github.com/ncruces/julianday/README.md+9
This diff is too big to show here.
vendor/github.com/ncruces/julianday/julianday.go+124
This diff is too big to show here.
vendor/github.com/nfnt/resize/.travis.yml+7
This diff is too big to show here.
vendor/github.com/nfnt/resize/LICENSE+13
This diff is too big to show here.
vendor/github.com/nfnt/resize/README.md+151
This diff is too big to show here.
vendor/github.com/nfnt/resize/converter.go+438
This diff is too big to show here.
vendor/github.com/nfnt/resize/filters.go+143
This diff is too big to show here.
vendor/github.com/nfnt/resize/nearest.go+318
This diff is too big to show here.
vendor/github.com/nfnt/resize/resize.go+620
This diff is too big to show here.
vendor/github.com/nfnt/resize/thumbnail.go+55
This diff is too big to show here.
vendor/github.com/nfnt/resize/ycc.go+387
This diff is too big to show here.
vendor/github.com/nxadm/tail/.cirrus.yml+8
This diff is too big to show here.
vendor/github.com/nxadm/tail/.gitignore+2
This diff is too big to show here.
vendor/github.com/nxadm/tail/CHANGES.md+64
This diff is too big to show here.
vendor/github.com/nxadm/tail/CONTRIBUTING.md+5
This diff is too big to show here.
vendor/github.com/nxadm/tail/Dockerfile+19
This diff is too big to show here.
vendor/github.com/nxadm/tail/LICENSE+21
This diff is too big to show here.
vendor/github.com/nxadm/tail/README.md+45
This diff is too big to show here.
vendor/github.com/nxadm/tail/ratelimiter/Licence+7
This diff is too big to show here.
vendor/github.com/nxadm/tail/ratelimiter/leakybucket.go+97
This diff is too big to show here.
vendor/github.com/nxadm/tail/ratelimiter/memory.go+60
This diff is too big to show here.
vendor/github.com/nxadm/tail/ratelimiter/storage.go+6
This diff is too big to show here.
vendor/github.com/nxadm/tail/tail.go+481
This diff is too big to show here.
vendor/github.com/nxadm/tail/tail_posix.go+17
This diff is too big to show here.
vendor/github.com/nxadm/tail/tail_windows.go+19
This diff is too big to show here.
vendor/github.com/nxadm/tail/util/util.go+49
This diff is too big to show here.
vendor/github.com/nxadm/tail/watch/filechanges.go+37
This diff is too big to show here.
vendor/github.com/nxadm/tail/watch/inotify.go+136
This diff is too big to show here.
vendor/github.com/nxadm/tail/watch/inotify_tracker.go+249
This diff is too big to show here.
vendor/github.com/nxadm/tail/watch/polling.go+119
This diff is too big to show here.
vendor/github.com/nxadm/tail/watch/watch.go+21
This diff is too big to show here.
vendor/github.com/nxadm/tail/winfile/winfile.go+93
This diff is too big to show here.
vendor/github.com/openai/openai-go/.gitignore+4
This diff is too big to show here.
vendor/github.com/openai/openai-go/.release-please-manifest.json+3
This diff is too big to show here.
vendor/github.com/openai/openai-go/.stats.yml+4
This diff is too big to show here.
vendor/github.com/openai/openai-go/Brewfile+1
This diff is too big to show here.
vendor/github.com/openai/openai-go/CHANGELOG.md+392
This diff is too big to show here.
vendor/github.com/openai/openai-go/CONTRIBUTING.md+66
This diff is too big to show here.
vendor/github.com/openai/openai-go/LICENSE+201
This diff is too big to show here.
vendor/github.com/openai/openai-go/MIGRATION.md+284
This diff is too big to show here.
vendor/github.com/openai/openai-go/README.md+948
This diff is too big to show here.
vendor/github.com/openai/openai-go/SECURITY.md+29
This diff is too big to show here.
vendor/github.com/openai/openai-go/aliases.go+440
This diff is too big to show here.
vendor/github.com/openai/openai-go/api.md+785
This diff is too big to show here.
vendor/github.com/openai/openai-go/audio.go+53
This diff is too big to show here.
vendor/github.com/openai/openai-go/audiospeech.go+129
This diff is too big to show here.
vendor/github.com/openai/openai-go/audiotranscription.go+654
This diff is too big to show here.
vendor/github.com/openai/openai-go/audiotranslation.go+117
This diff is too big to show here.
vendor/github.com/openai/openai-go/azure/azure.go+237
This diff is too big to show here.
vendor/github.com/openai/openai-go/batch.go+343
This diff is too big to show here.
vendor/github.com/openai/openai-go/beta.go+31
This diff is too big to show here.
vendor/github.com/openai/openai-go/betaassistant.go+2246
This diff is too big to show here.
vendor/github.com/openai/openai-go/betathread.go+1564
This diff is too big to show here.
vendor/github.com/openai/openai-go/betathreadmessage.go+1712
This diff is too big to show here.
vendor/github.com/openai/openai-go/betathreadrun.go+960
This diff is too big to show here.
vendor/github.com/openai/openai-go/betathreadrunstep.go+1393
This diff is too big to show here.
vendor/github.com/openai/openai-go/chat.go+28
This diff is too big to show here.
vendor/github.com/openai/openai-go/chatcompletion.go+2592
This diff is too big to show here.
vendor/github.com/openai/openai-go/chatcompletionmessage.go+96
This diff is too big to show here.
vendor/github.com/openai/openai-go/client.go+161
This diff is too big to show here.
vendor/github.com/openai/openai-go/completion.go+426
This diff is too big to show here.
vendor/github.com/openai/openai-go/container.go+352
This diff is too big to show here.
vendor/github.com/openai/openai-go/containerfile.go+286
This diff is too big to show here.
vendor/github.com/openai/openai-go/containerfilecontent.go+49
This diff is too big to show here.
vendor/github.com/openai/openai-go/embedding.go+203
This diff is too big to show here.
vendor/github.com/openai/openai-go/field.go+45
This diff is too big to show here.
vendor/github.com/openai/openai-go/file.go+313
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuning.go+34
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningalpha.go+28
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningalphagrader.go+672
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningcheckpoint.go+28
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningcheckpointpermission.go+254
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningjob.go+880
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningjobcheckpoint.go+149
This diff is too big to show here.
vendor/github.com/openai/openai-go/finetuningmethod.go+1487
This diff is too big to show here.
vendor/github.com/openai/openai-go/grader.go+28
This diff is too big to show here.
vendor/github.com/openai/openai-go/gradergradermodel.go+1179
This diff is too big to show here.
vendor/github.com/openai/openai-go/image.go+645
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apierror/apierror.go+58
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiform/encoder.go+465
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiform/form.go+5
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiform/richparam.go+20
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiform/tag.go+51
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/decoder.go+691
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/encoder.go+392
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/enum.go+145
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/field.go+23
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/port.go+120
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/registry.go+51
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/subfield.go+67
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/tag.go+47
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apijson/union.go+202
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiquery/encoder.go+415
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiquery/query.go+55
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiquery/richparam.go+20
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/apiquery/tag.go+44
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/decode.go+1324
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/encode.go+1391
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/fold.go+48
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/indent.go+182
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/scanner.go+610
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/sentinel/null.go+46
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/shims/shims.go+111
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/stream.go+512
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/tables.go+218
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/tags.go+38
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/encoding/json/time.go+61
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/paramutil/field.go+30
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/paramutil/union.go+48
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/requestconfig/requestconfig.go+635
This diff is too big to show here.
vendor/github.com/openai/openai-go/internal/version.go+5
This diff is too big to show here.
vendor/github.com/openai/openai-go/model.go+134
This diff is too big to show here.
vendor/github.com/openai/openai-go/moderation.go+485
This diff is too big to show here.
vendor/github.com/openai/openai-go/option/middleware.go+38
This diff is too big to show here.
vendor/github.com/openai/openai-go/option/requestoption.go+298
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/pagination/pagination.go+223
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/param/encoder.go+101
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/param/null.go+19
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/param/option.go+121
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/param/param.go+168
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/respjson/respjson.go+88
This diff is too big to show here.
vendor/github.com/openai/openai-go/packages/ssestream/ssestream.go+216
This diff is too big to show here.
vendor/github.com/openai/openai-go/polling.go+95
This diff is too big to show here.
vendor/github.com/openai/openai-go/release-please-config.json+67
This diff is too big to show here.
vendor/github.com/openai/openai-go/responses/aliases.go+440
This diff is too big to show here.
vendor/github.com/openai/openai-go/responses/inputitem.go+136
This diff is too big to show here.
vendor/github.com/openai/openai-go/responses/response.go+12897
This diff is too big to show here.
vendor/github.com/openai/openai-go/shared/constant/constants.go+721
This diff is too big to show here.
vendor/github.com/openai/openai-go/shared/shared.go+796
This diff is too big to show here.
vendor/github.com/openai/openai-go/streamaccumulator.go+195
This diff is too big to show here.
vendor/github.com/openai/openai-go/upload.go+201
This diff is too big to show here.
vendor/github.com/openai/openai-go/uploadpart.go+112
This diff is too big to show here.
vendor/github.com/openai/openai-go/vectorstore.go+905
This diff is too big to show here.
vendor/github.com/openai/openai-go/vectorstorefile.go+534
This diff is too big to show here.
vendor/github.com/openai/openai-go/vectorstorefilebatch.go+364
This diff is too big to show here.
vendor/github.com/openai/openai-go/webhooks/aliases.go+440
This diff is too big to show here.
vendor/github.com/openai/openai-go/webhooks/webhook.go+1208
This diff is too big to show here.
vendor/github.com/pkg/browser/LICENSE+23
This diff is too big to show here.
vendor/github.com/pkg/browser/README.md+55
This diff is too big to show here.
vendor/github.com/pkg/browser/browser.go+57
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_darwin.go+5
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_freebsd.go+14
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_linux.go+21
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_netbsd.go+14
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_openbsd.go+14
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_unsupported.go+12
This diff is too big to show here.
vendor/github.com/pkg/browser/browser_windows.go+7
This diff is too big to show here.
vendor/github.com/pmezard/go-difflib/LICENSE+27
This diff is too big to show here.
vendor/github.com/pmezard/go-difflib/difflib/difflib.go+772
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/.gitignore+18
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/.golangci.yaml+31
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/.goreleaser.yaml+36
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/CHANGELOG.md+291
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/LICENSE+22
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/Makefile+144
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/README.md+493
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/create.go+120
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/database/dialect.go+172
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/database/doc.go+14
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/database/sql_extended.go+23
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/database/store.go+66
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/database/store_extended.go+33
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/db.go+46
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/dialect.go+64
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/down.go+107
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/fix.go+54
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/globals.go+104
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/goose.go+141
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/helpers.go+84
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/install.sh+37
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/controller/controller.go+37
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/clickhouse.go+44
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/dialectquery.go+59
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/mysql.go+53
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/postgres.go+54
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/redshift.go+43
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/sqlite3.go+42
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/sqlserver.go+42
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/starrocks.go+45
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/tidb.go+43
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/turso.go+7
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/vertica.go+43
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialectquery/ydb.go+53
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/dialects.go+18
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/dialect/store.go+169
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/gooseutil/resolve.go+124
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/sqlparser/parse.go+59
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/internal/sqlparser/parser.go+394
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/lock/postgres.go+118
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/lock/session_locker.go+23
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/lock/session_locker_options.go+98
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/log.go+36
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/migrate.go+378
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/migration.go+398
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/migration_sql.go+115
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/osfs.go+28
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider.go+650
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider_collect.go+196
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider_errors.go+48
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider_options.go+203
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider_run.go+453
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/provider_types.go+91
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/redo.go+51
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/register.go+133
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/reset.go+64
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/status.go+64
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/up.go+221
This diff is too big to show here.
vendor/github.com/pressly/goose/v3/version.go+52
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/.gitignore+86
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/LICENSE+21
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/Makefile+9
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/common.go+19
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/formats.go+10
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/jsons.go+32
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/loader.go+101
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/merge/map.go+55
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/merger.go+170
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/merger_extensions.go+27
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/merger_loader.go+28
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/readme.md+152
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/rule/field.go+57
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/rule/merge.go+75
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/rule/rule.go+93
This diff is too big to show here.
vendor/github.com/qjebbs/go-jsons/rule/sort.go+95
This diff is too big to show here.
vendor/github.com/rivo/uniseg/LICENSE.txt+21
This diff is too big to show here.
vendor/github.com/rivo/uniseg/README.md+137
This diff is too big to show here.
vendor/github.com/rivo/uniseg/doc.go+108
This diff is too big to show here.
vendor/github.com/rivo/uniseg/eastasianwidth.go+2588
This diff is too big to show here.
vendor/github.com/rivo/uniseg/emojipresentation.go+295
This diff is too big to show here.
vendor/github.com/rivo/uniseg/gen_breaktest.go+215
This diff is too big to show here.
vendor/github.com/rivo/uniseg/gen_properties.go+261
This diff is too big to show here.
vendor/github.com/rivo/uniseg/grapheme.go+331
This diff is too big to show here.
vendor/github.com/rivo/uniseg/graphemeproperties.go+1915
This diff is too big to show here.
vendor/github.com/rivo/uniseg/graphemerules.go+176
This diff is too big to show here.
vendor/github.com/rivo/uniseg/line.go+134
This diff is too big to show here.
vendor/github.com/rivo/uniseg/lineproperties.go+3554
This diff is too big to show here.
vendor/github.com/rivo/uniseg/linerules.go+626
This diff is too big to show here.
vendor/github.com/rivo/uniseg/properties.go+208
This diff is too big to show here.
vendor/github.com/rivo/uniseg/sentence.go+90
This diff is too big to show here.
vendor/github.com/rivo/uniseg/sentenceproperties.go+2845
This diff is too big to show here.
vendor/github.com/rivo/uniseg/sentencerules.go+276
This diff is too big to show here.
vendor/github.com/rivo/uniseg/step.go+242
This diff is too big to show here.
vendor/github.com/rivo/uniseg/width.go+61
This diff is too big to show here.
vendor/github.com/rivo/uniseg/word.go+89
This diff is too big to show here.
vendor/github.com/rivo/uniseg/wordproperties.go+1883
This diff is too big to show here.
vendor/github.com/rivo/uniseg/wordrules.go+282
This diff is too big to show here.
vendor/github.com/sabhiram/go-gitignore/.gitignore+28
This diff is too big to show here.
vendor/github.com/sabhiram/go-gitignore/LICENSE+22
This diff is too big to show here.
vendor/github.com/sabhiram/go-gitignore/README.md+15
This diff is too big to show here.
vendor/github.com/sabhiram/go-gitignore/ignore.go+239
This diff is too big to show here.
vendor/github.com/sabhiram/go-gitignore/version_gen.go+12
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/.editorconfig+18
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/.gitignore+2
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/.travis.yml+8
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/CONTRIBUTING.md+1
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/Gopkg.lock+20
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/Gopkg.toml+4
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/LICENSE+21
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/Makefile+57
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/README.md+186
This diff is too big to show here.
vendor/github.com/sahilm/fuzzy/fuzzy.go+254
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/LICENSE+202
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/README.md+185
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/backoff.go+134
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/backoff_constant.go+25
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/backoff_exponential.go+47
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/backoff_fibonacci.go+56
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/rand.go+54
This diff is too big to show here.
vendor/github.com/sethvargo/go-retry/retry.go+104
This diff is too big to show here.
vendor/github.com/spf13/cast/.gitignore+25
This diff is too big to show here.
vendor/github.com/spf13/cast/LICENSE+21
This diff is too big to show here.
vendor/github.com/spf13/cast/Makefile+40
This diff is too big to show here.
vendor/github.com/spf13/cast/README.md+75
This diff is too big to show here.
vendor/github.com/spf13/cast/cast.go+176
This diff is too big to show here.
vendor/github.com/spf13/cast/caste.go+1510
This diff is too big to show here.
vendor/github.com/spf13/cast/timeformattype_string.go+27
This diff is too big to show here.
vendor/github.com/spf13/cobra/.gitignore+39
This diff is too big to show here.
vendor/github.com/spf13/cobra/.golangci.yml+57
This diff is too big to show here.
vendor/github.com/spf13/cobra/.mailmap+3
This diff is too big to show here.
vendor/github.com/spf13/cobra/CONDUCT.md+37
This diff is too big to show here.
vendor/github.com/spf13/cobra/CONTRIBUTING.md+50
This diff is too big to show here.
vendor/github.com/spf13/cobra/LICENSE.txt+174
This diff is too big to show here.
vendor/github.com/spf13/cobra/MAINTAINERS+13
This diff is too big to show here.
vendor/github.com/spf13/cobra/Makefile+35
This diff is too big to show here.
vendor/github.com/spf13/cobra/README.md+113
This diff is too big to show here.
vendor/github.com/spf13/cobra/active_help.go+60
This diff is too big to show here.
vendor/github.com/spf13/cobra/args.go+131
This diff is too big to show here.
vendor/github.com/spf13/cobra/bash_completions.go+709
This diff is too big to show here.
vendor/github.com/spf13/cobra/bash_completionsV2.go+484
This diff is too big to show here.
vendor/github.com/spf13/cobra/cobra.go+246
This diff is too big to show here.
vendor/github.com/spf13/cobra/command.go+2067
This diff is too big to show here.
vendor/github.com/spf13/cobra/command_notwin.go+20
This diff is too big to show here.
vendor/github.com/spf13/cobra/command_win.go+41
This diff is too big to show here.
vendor/github.com/spf13/cobra/completions.go+1005
This diff is too big to show here.
vendor/github.com/spf13/cobra/fish_completions.go+292
This diff is too big to show here.
vendor/github.com/spf13/cobra/flag_groups.go+290
This diff is too big to show here.
vendor/github.com/spf13/cobra/powershell_completions.go+350
This diff is too big to show here.
vendor/github.com/spf13/cobra/shell_completions.go+98
This diff is too big to show here.
vendor/github.com/spf13/cobra/zsh_completions.go+308
This diff is too big to show here.
vendor/github.com/spf13/pflag/.editorconfig+12
This diff is too big to show here.
vendor/github.com/spf13/pflag/.gitignore+2
This diff is too big to show here.
vendor/github.com/spf13/pflag/.golangci.yaml+4
This diff is too big to show here.
vendor/github.com/spf13/pflag/.travis.yml+22
This diff is too big to show here.
vendor/github.com/spf13/pflag/LICENSE+28
This diff is too big to show here.
vendor/github.com/spf13/pflag/README.md+296
This diff is too big to show here.
vendor/github.com/spf13/pflag/bool.go+94
This diff is too big to show here.
vendor/github.com/spf13/pflag/bool_slice.go+185
This diff is too big to show here.
vendor/github.com/spf13/pflag/bytes.go+209
This diff is too big to show here.
vendor/github.com/spf13/pflag/count.go+96
This diff is too big to show here.
vendor/github.com/spf13/pflag/duration.go+86
This diff is too big to show here.
vendor/github.com/spf13/pflag/duration_slice.go+166
This diff is too big to show here.
vendor/github.com/spf13/pflag/flag.go+1246
This diff is too big to show here.
vendor/github.com/spf13/pflag/float32.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/float32_slice.go+174
This diff is too big to show here.
vendor/github.com/spf13/pflag/float64.go+84
This diff is too big to show here.
vendor/github.com/spf13/pflag/float64_slice.go+166
This diff is too big to show here.
vendor/github.com/spf13/pflag/golangflag.go+105
This diff is too big to show here.
vendor/github.com/spf13/pflag/int.go+84
This diff is too big to show here.
vendor/github.com/spf13/pflag/int16.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/int32.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/int32_slice.go+174
This diff is too big to show here.
vendor/github.com/spf13/pflag/int64.go+84
This diff is too big to show here.
vendor/github.com/spf13/pflag/int64_slice.go+166
This diff is too big to show here.
vendor/github.com/spf13/pflag/int8.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/int_slice.go+158
This diff is too big to show here.
vendor/github.com/spf13/pflag/ip.go+97
This diff is too big to show here.
vendor/github.com/spf13/pflag/ip_slice.go+186
This diff is too big to show here.
vendor/github.com/spf13/pflag/ipmask.go+122
This diff is too big to show here.
vendor/github.com/spf13/pflag/ipnet.go+98
This diff is too big to show here.
vendor/github.com/spf13/pflag/ipnet_slice.go+147
This diff is too big to show here.
vendor/github.com/spf13/pflag/string.go+80
This diff is too big to show here.
vendor/github.com/spf13/pflag/string_array.go+125
This diff is too big to show here.
vendor/github.com/spf13/pflag/string_slice.go+163
This diff is too big to show here.
vendor/github.com/spf13/pflag/string_to_int.go+149
This diff is too big to show here.
vendor/github.com/spf13/pflag/string_to_int64.go+149
This diff is too big to show here.
vendor/github.com/spf13/pflag/string_to_string.go+160
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint16.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint32.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint64.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint8.go+88
This diff is too big to show here.
vendor/github.com/spf13/pflag/uint_slice.go+168
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/.gitignore+2
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/LICENSE+29
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/README.md+49
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/definitions.go+16
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/draw.go+392
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/icon_cursor.go+391
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/path_cursor.go+397
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/path_style.go+35
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/public.go+287
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/svg_icon.go+37
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/svg_path.go+109
This diff is too big to show here.
vendor/github.com/srwiley/oksvg/utils.go+172
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/LICENSE+29
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/README.md+84
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/dash.go+202
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/fill.go+241
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/geomx.go+306
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/gradient.go+310
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/matrix.go+191
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/scan.go+181
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/shapes.go+221
This diff is too big to show here.
vendor/github.com/srwiley/rasterx/stroke.go+677
This diff is too big to show here.
vendor/github.com/stretchr/testify/LICENSE+21
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_compare.go+489
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_format.go+841
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl+5
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_forward.go+1673
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl+5
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertion_order.go+81
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/assertions.go+2184
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/doc.go+46
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/errors.go+10
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/forward_assertions.go+16
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/http_assertions.go+165
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go+25
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go+37
This diff is too big to show here.
vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go+18
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/doc.go+29
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/forward_requirements.go+16
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/require.go+2124
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/require.go.tmpl+6
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/require_forward.go+1674
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/require_forward.go.tmpl+5
This diff is too big to show here.
vendor/github.com/stretchr/testify/require/requirements.go+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/.editorconfig+7
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/.gitattributes+2
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/.gitignore+46
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/.gitmodules+3
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/CONTRIBUTING.md+75
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/LICENSE+201
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/Makefile+364
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/NOTICE+2
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/RATIONALE.md+1587
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/README.md+139
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/api/features.go+214
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/api/wasm.go+766
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/builder.go+367
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/cache.go+123
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/codecov.yml+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/config.go+899
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/checkpoint.go+35
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/close.go+63
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/experimental.go+41
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/features.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/importresolver.go+19
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/listener.go+324
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/memory.go+52
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/dir.go+92
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/errno.go+98
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/error.go+45
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/file.go+316
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/fs.go+292
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/oflag.go+70
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno.go+106
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_notwindows.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_unsupported.go+7
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_windows.go+66
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/time.go+10
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/experimental/sys/unimplemented.go+160
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/fsconfig.go+213
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/descriptor/table.go+149
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/compiler.go+3632
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/format.go+22
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go+4596
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/operations.go+2812
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/signature.go+767
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/abi.go+170
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/backend.go+3
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler.go+399
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler_lower.go+226
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/go_call.go+33
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi.go+186
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.go+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.s+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_preamble.go+248
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_go_call.go+440
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/cond.go+168
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/ext.go+35
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr.go+2447
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr_encoding.go+1683
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_constant.go+71
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_mem.go+187
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine.go+3733
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_pro_epi_logue.go+303
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_regalloc.go+352
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_vec.go+992
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/operands.go+336
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/reg.go+181
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/stack.go+130
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi.go+333
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.go+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.s+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_preamble.go+233
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_go_call.go+430
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/cond.go+215
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr.go+2534
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr_encoding.go+2351
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_constant.go+301
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr.go+2224
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr_operands.go+340
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_mem.go+451
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine.go+631
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_pro_epi_logue.go+467
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_regalloc.go+351
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_relocation.go+122
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/reg.go+397
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/unwind_stack.go+84
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/machine.go+119
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/api.go+124
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/reg.go+123
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regalloc.go+1189
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regset.go+96
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/vdef.go+19
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/call_engine.go+708
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine.go+843
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine_cache.go+303
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_amd64.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_arm64.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_others.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/frontend.go+567
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/lower.go+4261
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/misc.go+10
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/sort_id.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/hostmodule.go+88
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_amd64.go+30
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_arm64.go+32
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_other.go+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/memmove.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/module_engine.go+331
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block.go+379
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block_sort.go+32
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/builder.go+790
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/cmp.go+107
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/funcref.go+12
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/instructions.go+2976
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass.go+393
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_blk_layouts.go+334
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_cfg.go+313
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/signature.go+49
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/ssa.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/type.go+115
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/vs.go+114
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/debug_options.go+196
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/exitcode.go+109
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/offsetdata.go+216
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap.go+96
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_disabled.go+5
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_enabled.go+5
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/pool.go+215
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/ptr.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/queue.go+26
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/resetmap.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/checkpoint.go+10
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/close.go+5
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/expctxkeys.go+2
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/importresolver.go+6
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/listener.go+7
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/expctxkeys/memory.go+4
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go+42
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go+76
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/fsapi/file.go+69
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/fsapi/poll.go+20
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/fsapi/unimplemented.go+27
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/internalapi/internal.go+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/leb128/leb128.go+285
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go+271
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid.go+35
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go+80
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.s+16
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_arm64.go+71
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_arm64.s+21
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_unsupported.go+17
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go+17
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go+76
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go+18
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go+32
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go+26
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go+95
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_bsd.go+22
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go+10
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_unsupported.go+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/path.go+6
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go+17
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/platform.go+56
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/time.go+76
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/time_notcgo.go+7
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go+40
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sock/sock.go+89
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sock/sock_supported.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sock/sock_unsupported.go+10
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sys/fs.go+457
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sys/lazy.go+151
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sys/stdio.go+128
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sys/sys.go+228
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go+105
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_tinygo.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go+24
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go+99
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs_supported.go+48
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs_unsupported.go+34
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/file.go+523
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go+39
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go+28
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/file_windows.go+175
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go+37
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go+51
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s+8
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go+49
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go+18
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go+42
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/ino.go+22
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/ino_plan9.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/ino_tinygo.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/ino_windows.go+28
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go+17
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unsupported.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go+23
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/oflag.go+38
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_darwin.go+26
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_freebsd.go+24
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_linux.go+30
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_notwindows.go+20
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_sun.go+31
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_tinygo.go+25
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unsupported.go+18
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go+161
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go+319
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll.go+18
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.go+55
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.s+8
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll_linux.go+59
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll_unsupported.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/poll_windows.go+224
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go+117
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/rename.go+16
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_plan9.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go+55
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go+187
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_supported.go+77
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go+49
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go+81
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go+80
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go+16
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_bsd.go+37
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_linux.go+40
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go+40
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go+120
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go+20
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go+13
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go+6
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink.go+17
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_plan9.go+12
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go+25
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/u32/u32.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/u64/u64.go+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/version/version.go+52
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go+100
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go+105
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go+22
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go+79
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go+193
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go+269
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go+11
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go+32
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go+56
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go+50
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go+9
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go+52
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go+47
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go+42
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go+151
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go+226
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go+43
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go+59
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/counts.go+51
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/engine.go+76
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go+2336
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go+188
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/global.go+55
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go+279
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/host.go+179
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go+1866
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go+476
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go+128
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/module.go+1078
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go+251
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance_lookup.go+73
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/store.go+679
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go+95
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasm/table.go+339
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go+170
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go+225
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go+50
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/netlify.toml+15
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/runtime.go+399
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/clock.go+26
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/error.go+83
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/stat.go+105
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/stat_bsd.go+29
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/stat_linux.go+32
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/stat_unsupported.go+14
This diff is too big to show here.
vendor/github.com/tetratelabs/wazero/sys/stat_windows.go+26
This diff is too big to show here.
vendor/github.com/tidwall/gjson/LICENSE+20
This diff is too big to show here.
vendor/github.com/tidwall/gjson/README.md+492
This diff is too big to show here.
vendor/github.com/tidwall/gjson/SYNTAX.md+360
This diff is too big to show here.
vendor/github.com/tidwall/gjson/gjson.go+3603
This diff is too big to show here.
vendor/github.com/tidwall/match/LICENSE+20
This diff is too big to show here.
vendor/github.com/tidwall/match/README.md+29
This diff is too big to show here.
vendor/github.com/tidwall/match/match.go+237
This diff is too big to show here.
vendor/github.com/tidwall/pretty/LICENSE+20
This diff is too big to show here.
vendor/github.com/tidwall/pretty/README.md+122
This diff is too big to show here.
vendor/github.com/tidwall/pretty/pretty.go+682
This diff is too big to show here.
vendor/github.com/tidwall/sjson/LICENSE+21
This diff is too big to show here.
vendor/github.com/tidwall/sjson/README.md+278
This diff is too big to show here.
vendor/github.com/tidwall/sjson/logo.png
This diff is too big to show here.
vendor/github.com/tidwall/sjson/sjson.go+737
This diff is too big to show here.
vendor/github.com/xo/terminfo/.gitignore+9
This diff is too big to show here.
vendor/github.com/xo/terminfo/LICENSE+21
This diff is too big to show here.
vendor/github.com/xo/terminfo/README.md+139
This diff is too big to show here.
vendor/github.com/xo/terminfo/caps.go+31
This diff is too big to show here.
vendor/github.com/xo/terminfo/capvals.go+1525
This diff is too big to show here.
vendor/github.com/xo/terminfo/color.go+88
This diff is too big to show here.
vendor/github.com/xo/terminfo/dec.go+245
This diff is too big to show here.
vendor/github.com/xo/terminfo/load.go+64
This diff is too big to show here.
vendor/github.com/xo/terminfo/param.go+405
This diff is too big to show here.
vendor/github.com/xo/terminfo/stack.go+48
This diff is too big to show here.
vendor/github.com/xo/terminfo/terminfo.go+479
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/LICENSE+25
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/README.rst+46
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/compile.go+224
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/equals.go+53
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/error.go+16
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/escape.go+190
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/expression.go+173
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/machine.go+23
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/match.go+213
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/parse.go+277
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/prog.go+130
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/uritemplate.go+116
This diff is too big to show here.
vendor/github.com/yosida95/uritemplate/v3/value.go+216
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/.gitignore+15
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/LICENSE+21
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/README.md+70
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/ast/emoji.go+42
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/definition/definition.go+106
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/definition/github.go+1889
This diff is too big to show here.
vendor/github.com/yuin/goldmark-emoji/emoji.go+360
This diff is too big to show here.
vendor/github.com/yuin/goldmark/.gitignore+19
This diff is too big to show here.
vendor/github.com/yuin/goldmark/.golangci.yml+105
This diff is too big to show here.
vendor/github.com/yuin/goldmark/LICENSE+21
This diff is too big to show here.
vendor/github.com/yuin/goldmark/Makefile+13
This diff is too big to show here.
vendor/github.com/yuin/goldmark/README.md+568
This diff is too big to show here.
vendor/github.com/yuin/goldmark/ast/ast.go+521
This diff is too big to show here.
vendor/github.com/yuin/goldmark/ast/block.go+547
This diff is too big to show here.
vendor/github.com/yuin/goldmark/ast/inline.go+573
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/ast/definition_list.go+83
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/ast/footnote.go+138
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/ast/strikethrough.go+29
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/ast/table.go+158
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/ast/tasklist.go+35
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/cjk.go+72
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/definition_list.go+274
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/footnote.go+691
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/gfm.go+18
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/linkify.go+322
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/package.go+2
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/strikethrough.go+118
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/table.go+564
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/tasklist.go+120
This diff is too big to show here.
vendor/github.com/yuin/goldmark/extension/typographer.go+348
This diff is too big to show here.
vendor/github.com/yuin/goldmark/markdown.go+141
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/attribute.go+329
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/atx_heading.go+248
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/auto_link.go+42
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/blockquote.go+70
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/code_block.go+102
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/code_span.go+84
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/delimiter.go+238
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/emphasis.go+50
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/fcode_block.go+122
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/html_block.go+229
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/link.go+449
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/link_ref.go+152
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/list.go+287
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/list_item.go+90
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/paragraph.go+72
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/parser.go+1261
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/raw_html.go+153
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/setext_headings.go+126
This diff is too big to show here.
vendor/github.com/yuin/goldmark/parser/thematic_break.go+75
This diff is too big to show here.
vendor/github.com/yuin/goldmark/renderer/html/html.go+1021
This diff is too big to show here.
vendor/github.com/yuin/goldmark/renderer/renderer.go+174
This diff is too big to show here.
vendor/github.com/yuin/goldmark/text/package.go+2
This diff is too big to show here.
vendor/github.com/yuin/goldmark/text/reader.go+660
This diff is too big to show here.
vendor/github.com/yuin/goldmark/text/segment.go+239
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/html5entities.go+2155
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/unicode_case_folding.go+1535
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/util.go+988
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/util_cjk.go+469
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/util_safe.go+14
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/util_unsafe_go120.go+24
This diff is too big to show here.
vendor/github.com/yuin/goldmark/util/util_unsafe_go121.go+18
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/CONTRIBUTING.md+27
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/LICENSE+201
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/VERSIONING.md+15
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/doc.go+14
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/attr.go+58
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/doc.go+8
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/id.go+103
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/number.go+67
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/resource.go+66
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/scope.go+67
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/span.go+456
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/status.go+40
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/traces.go+189
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/internal/telemetry/value.go+452
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/limit.go+94
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/span.go+432
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/tracer.go+124
This diff is too big to show here.
vendor/go.opentelemetry.io/auto/sdk/tracer_provider.go+33
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/LICENSE+201
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/client.go+50
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/common.go+34
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go+207
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/doc.go+7
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go+217
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/body_wrapper.go+75
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request/resp_writer_wrapper.go+112
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go+165
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/httpconv.go+348
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/util.go+98
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconv/v1.20.0.go+192
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go+10
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go+575
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go+205
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/labeler.go+58
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go+295
This diff is too big to show here.
vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go+17
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.codespellignore+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.codespellrc+10
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.gitattributes+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.gitignore+15
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.golangci.yml+252
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.lycheeignore+6
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/.markdownlint.yaml+29
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/CHANGELOG.md+3344
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/CODEOWNERS+17
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/CONTRIBUTING.md+676
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/LICENSE+201
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/Makefile+328
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/README.md+120
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/RELEASING.md+132
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/VERSIONING.md+224
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/doc.go+5
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/encoder.go+135
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/filter.go+49
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/iterator.go+150
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/key.go+123
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/kv.go+75
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/set.go+411
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/type_string.go+31
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/attribute/value.go+271
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/baggage/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/baggage/baggage.go+1018
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/baggage/context.go+28
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/baggage/doc.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/codes/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/codes/codes.go+106
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/codes/doc.go+10
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/dependencies.Dockerfile+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/doc.go+25
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/error_handler.go+27
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/get_main_pkgs.sh+30
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/handler.go+33
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go+96
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go+32
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/baggage/context.go+81
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/gen.go+18
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/handler.go+36
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/instruments.go+412
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go+62
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/meter.go+598
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/propagator.go+71
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/state.go+199
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/global/trace.go+220
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal/rawhelpers.go+48
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/internal_logging.go+15
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric.go+42
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/LICENSE+201
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go+260
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/asyncint64.go+258
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/config.go+81
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/doc.go+177
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/embedded/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go+243
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/instrument.go+368
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/meter.go+278
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/noop/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/noop/noop.go+281
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/syncfloat64.go+226
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/metric/syncint64.go+226
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation.go+20
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation/baggage.go+47
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation/doc.go+13
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation/propagation.go+142
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/propagation/trace_context.go+156
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/renovate.json+30
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/requirements.txt+1
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go+1198
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go+188
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go+10
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go+2060
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go+2599
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/attribute_group.go+8996
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/doc.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/exception.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/metric.go+1307
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/semconv/v1.26.0/schema.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace.go+36
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/LICENSE+201
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/auto.go+661
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/config.go+323
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/context.go+50
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/doc.go+119
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/embedded/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go+45
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/attr.go+58
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/doc.go+8
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/id.go+103
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/number.go+67
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/resource.go+66
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/scope.go+67
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/span.go+460
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/status.go+40
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/traces.go+189
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/internal/telemetry/value.go+453
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/nonrecording.go+16
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/noop.go+103
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/noop/README.md+3
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/noop/noop.go+112
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/provider.go+59
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/span.go+177
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/trace.go+323
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/tracer.go+37
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/trace/tracestate.go+330
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/verify_readmes.sh+21
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/verify_released_changelog.sh+42
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/version.go+9
This diff is too big to show here.
vendor/go.opentelemetry.io/otel/versions.yaml+43
This diff is too big to show here.
vendor/go.uber.org/multierr/.codecov.yml+15
This diff is too big to show here.
vendor/go.uber.org/multierr/.gitignore+4
This diff is too big to show here.
vendor/go.uber.org/multierr/CHANGELOG.md+95
This diff is too big to show here.
vendor/go.uber.org/multierr/LICENSE.txt+19
This diff is too big to show here.
vendor/go.uber.org/multierr/Makefile+38
This diff is too big to show here.
vendor/go.uber.org/multierr/README.md+43
This diff is too big to show here.
vendor/go.uber.org/multierr/error.go+646
This diff is too big to show here.
vendor/go.uber.org/multierr/error_post_go120.go+48
This diff is too big to show here.
vendor/go.uber.org/multierr/error_pre_go120.go+79
This diff is too big to show here.
vendor/golang.org/x/crypto/LICENSE+27
This diff is too big to show here.
vendor/golang.org/x/crypto/PATENTS+22
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_arm64.go+16
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_arm64.s+307
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_generic.go+398
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_noasm.go+13
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.go+16
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_ppc64x.s+501
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_s390x.go+27
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/chacha_s390x.s+224
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20/xor.go+42
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go+98
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go+86
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s+9762
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go+81
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go+15
This diff is too big to show here.
vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go+86
This diff is too big to show here.
vendor/golang.org/x/crypto/cryptobyte/asn1.go+825
This diff is too big to show here.
vendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go+46
This diff is too big to show here.
vendor/golang.org/x/crypto/cryptobyte/builder.go+350
This diff is too big to show here.
vendor/golang.org/x/crypto/cryptobyte/string.go+183
This diff is too big to show here.
vendor/golang.org/x/crypto/hkdf/hkdf.go+95
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/alias/alias.go+31
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/alias/alias_purego.go+34
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go+9
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/poly1305.go+99
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s+93
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go+47
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go+312
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s+123
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.s+187
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go+76
This diff is too big to show here.
vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s+503
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/bmp-string.go+50
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/crypto.go+131
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/errors.go+23
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2.go+268
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/mac.go+45
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/pbkdf.go+170
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/pkcs12.go+360
This diff is too big to show here.
vendor/golang.org/x/crypto/pkcs12/safebags.go+57
This diff is too big to show here.
vendor/golang.org/x/exp/LICENSE+27
This diff is too big to show here.
vendor/golang.org/x/exp/PATENTS+22
This diff is too big to show here.
vendor/golang.org/x/exp/slices/slices.go+182
This diff is too big to show here.
vendor/golang.org/x/exp/slices/sort.go+115
This diff is too big to show here.
vendor/golang.org/x/exp/slog/attr.go+102
This diff is too big to show here.
vendor/golang.org/x/exp/slog/doc.go+316
This diff is too big to show here.
vendor/golang.org/x/exp/slog/handler.go+577
This diff is too big to show here.
vendor/golang.org/x/exp/slog/internal/buffer/buffer.go+84
This diff is too big to show here.
vendor/golang.org/x/exp/slog/internal/ignorepc.go+9
This diff is too big to show here.
vendor/golang.org/x/exp/slog/json_handler.go+336
This diff is too big to show here.
vendor/golang.org/x/exp/slog/level.go+201
This diff is too big to show here.
vendor/golang.org/x/exp/slog/logger.go+343
This diff is too big to show here.
vendor/golang.org/x/exp/slog/noplog.bench+36
This diff is too big to show here.
vendor/golang.org/x/exp/slog/record.go+207
This diff is too big to show here.
vendor/golang.org/x/exp/slog/text_handler.go+161
This diff is too big to show here.
vendor/golang.org/x/exp/slog/value.go+456
This diff is too big to show here.
vendor/golang.org/x/exp/slog/value_119.go+53
This diff is too big to show here.
vendor/golang.org/x/exp/slog/value_120.go+39
This diff is too big to show here.
vendor/golang.org/x/image/LICENSE+27
This diff is too big to show here.
vendor/golang.org/x/image/PATENTS+22
This diff is too big to show here.
vendor/golang.org/x/image/colornames/colornames.go+10
This diff is too big to show here.
vendor/golang.org/x/image/colornames/table.go+457
This diff is too big to show here.
vendor/golang.org/x/image/math/fixed/fixed.go+410
This diff is too big to show here.
vendor/golang.org/x/image/vector/acc_amd64.go+29
This diff is too big to show here.
vendor/golang.org/x/image/vector/acc_amd64.s+1028
This diff is too big to show here.
vendor/golang.org/x/image/vector/acc_other.go+16
This diff is too big to show here.
vendor/golang.org/x/image/vector/gen_acc_amd64.s.tmpl+170
This diff is too big to show here.
vendor/golang.org/x/image/vector/raster_fixed.go+330
This diff is too big to show here.
vendor/golang.org/x/image/vector/raster_floating.go+220
This diff is too big to show here.
vendor/golang.org/x/image/vector/vector.go+472
This diff is too big to show here.
vendor/golang.org/x/net/LICENSE+27
This diff is too big to show here.
vendor/golang.org/x/net/PATENTS+22
This diff is too big to show here.
vendor/golang.org/x/net/html/atom/atom.go+78
This diff is too big to show here.
vendor/golang.org/x/net/html/atom/table.go+785
This diff is too big to show here.
vendor/golang.org/x/net/html/charset/charset.go+257
This diff is too big to show here.
vendor/golang.org/x/net/html/const.go+111
This diff is too big to show here.
992 more files changed are not listed.