Skip to content

Commit c8a6ad1

Browse files
[Identity] az identity federated-credential create/update: Add support for claims matching expressions (#31436)
Co-authored-by: Srujan Bandarkar <[email protected]>
1 parent 549775f commit c8a6ad1

File tree

19 files changed

+2031
-225
lines changed

19 files changed

+2031
-225
lines changed

src/azure-cli/azure/cli/command_modules/identity/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ def __init__(self, cli_ctx=None):
1919

2020
def load_command_table(self, args):
2121
from azure.cli.command_modules.identity.commands import load_command_table
22+
from azure.cli.core.aaz import load_aaz_command_table
23+
try:
24+
from . import aaz
25+
except ImportError:
26+
aaz = None
27+
if aaz:
28+
load_aaz_command_table(
29+
loader=self,
30+
aaz_pkg_name=aaz.__name__,
31+
args=args
32+
)
2233
load_command_table(self, args)
2334
return self.command_table
2435

src/azure-cli/azure/cli/command_modules/identity/_client_factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ def _msi_user_identities_operations(cli_ctx, _):
2424

2525
def _msi_operations_operations(cli_ctx, _):
2626
return _msi_client_factory(cli_ctx).operations
27-
28-
29-
def _msi_federated_identity_credentials_operations(cli_ctx, _):
30-
return _msi_client_factory(cli_ctx).federated_identity_credentials

src/azure-cli/azure/cli/command_modules/identity/_help.py

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -35,53 +35,3 @@
3535
type: command
3636
short-summary: List the associated resources for the identity.
3737
"""
38-
39-
helps['identity federated-credential'] = """
40-
type: group
41-
short-summary: Manage federated identity credentials under user assigned identities.
42-
"""
43-
44-
helps['identity federated-credential create'] = """
45-
type: command
46-
short-summary: Create a federated identity credential under an existing user assigned identity.
47-
examples:
48-
- name: Create a federated identity credential under a specific user assigned identity.
49-
text: |
50-
az identity federated-credential create --name myFicName --identity-name myIdentityName --resource-group myResourceGroup --issuer myIssuer --subject mySubject --audiences myAudiences
51-
"""
52-
53-
helps['identity federated-credential update'] = """
54-
type: command
55-
short-summary: Update a federated identity credential under an existing user assigned identity.
56-
examples:
57-
- name: Update a federated identity credential under a specific user assigned identity.
58-
text: |
59-
az identity federated-credential update --name myFicName --identity-name myIdentityName --resource-group myResourceGroup --issuer myIssuer --subject mySubject --audiences myAudiences
60-
"""
61-
62-
helps['identity federated-credential delete'] = """
63-
type: command
64-
short-summary: Delete a federated identity credential under an existing user assigned identity.
65-
examples:
66-
- name: Delete a federated identity credential under a specific user assigned identity.
67-
text: |
68-
az identity federated-credential delete --name myFicName --identity-name myIdentityName --resource-group myResourceGroup
69-
"""
70-
71-
helps['identity federated-credential show'] = """
72-
type: command
73-
short-summary: Show a federated identity credential under an existing user assigned identity.
74-
examples:
75-
- name: Show a federated identity credential under a specific user assigned identity.
76-
text: |
77-
az identity federated-credential show --name myFicName --identity-name myIdentityName --resource-group myResourceGroup
78-
"""
79-
80-
helps['identity federated-credential list'] = """
81-
type: command
82-
short-summary: List all federated identity credentials under an existing user assigned identity.
83-
examples:
84-
- name: List all federated identity credentials under an existing user assigned identity.
85-
text: |
86-
az identity federated-credential list --identity-name myIdentityName --resource-group myResourceGroup
87-
"""

src/azure-cli/azure/cli/command_modules/identity/_params.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from azure.cli.core.commands.parameters import get_location_type, tags_type
1010

11-
1211
name_arg_type = CLIArgumentType(options_list=('--name', '-n'), metavar='NAME',
1312
help='The name of the identity resource.')
1413

@@ -21,13 +20,3 @@ def load_arguments(self, _):
2120
with self.argument_context('identity create') as c:
2221
c.argument('location', get_location_type(self.cli_ctx), required=False)
2322
c.argument('tags', tags_type)
24-
25-
with self.argument_context('identity federated-credential', min_api='2022-01-31-preview') as c:
26-
c.argument('federated_credential_name', options_list=('--name', '-n'), help='The name of the federated identity credential resource.')
27-
c.argument('identity_name', help='The name of the identity resource.')
28-
29-
for scope in ['identity federated-credential create', 'identity federated-credential update']:
30-
with self.argument_context(scope) as c:
31-
c.argument('issuer', help='The openId connect metadata URL of the issuer of the identity provider that Azure AD would use in the token exchange protocol for validating tokens before issuing a token as the user-assigned managed identity.')
32-
c.argument('subject', help='The sub value in the token sent to Azure AD for getting the user-assigned managed identity token. The value configured in the federated credential and the one in the incoming token must exactly match for Azure AD to issue the access token.')
33-
c.argument('audiences', nargs='+', help='The aud value in the token sent to Azure for getting the user-assigned managed identity token. The value configured in the federated credential and the one in the incoming token must exactly match for Azure to issue the access token.')
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"identity",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Manage Managed Identity
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"identity federated-credential",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Manage federated identity credentials under user assigned identities.
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *
12+
from ._create import *
13+
from ._delete import *
14+
from ._list import *
15+
from ._show import *
16+
from ._update import *

0 commit comments

Comments
 (0)