Commit cec8579
committed
Use env var to set api key on install
This commit allows setting the authorization header for `gem install`
commands using the GEM_HOST_API_KEY environment variable. This is useful
when working with private registries using short lived api tokens (e.g.,
OIDC tokens). For example:
```
GEM_HOST_API_KEY="secret_token" gem install private_gem --clear-sources
\ --source https://private.repo.com
```
The GEM_HOST_API_KEY environment variable can already be used by the
`gem push` command. I'm simply extending it's usage to `gem install` as
well.1 parent b229140 commit cec8579
File tree
3 files changed
+26
-0
lines changed- lib/rubygems/commands
- test/rubygems
3 files changed
+26
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
760 | 764 | | |
761 | 765 | | |
762 | 766 | | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
763 | 783 | | |
764 | 784 | | |
765 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
0 commit comments