Commit 16afcbd
committed
Remove unnecessary network call in
`az acr cache create` and `az acr cache update` are used to create and
update cache rules under Azure Container Registry. A _cache rule_ is a
sub resource of a container registry.
Currently, when the above two operations are performed, the code first
makes a GET request to _registry_ resource, only to get the id of the
resource by its name. It needs the registry id in order to create
credential set id which is needed when creating and updating a cache
rule. The credential set id can be determined without making the above
GET request. This GET request is made on the registry resource, which
implies the executing user must have 'Reader' role of the registry. This
could lead to user overprivileging roles, e.g. now they have to give
executing user registry read permissions, in additoinal to cache rule
CRUD permissions.
This commit removed the GET registry request in cache create and cache
update workflow. As a result, a role with only cache rule permissions is
able to execute cache rule create and update. This makes our security
model clearer, and also makes the operation more efficient.az acr cache subcommand1 parent 89c41db commit 16afcbd
File tree
2 files changed
+28
-7
lines changed- src/azure-cli/azure/cli/command_modules/acr
2 files changed
+28
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
| |||
0 commit comments