|
24 | 24 | get_api_version_type, blob_download_file_path_validator, blob_tier_validator, validate_subnet, |
25 | 25 | validate_immutability_arguments, validate_blob_name_for_upload, validate_share_close_handle, |
26 | 26 | blob_tier_validator_track2, services_type_v2, resource_type_type_v2, PermissionScopeAddAction, |
27 | | - SshPublicKeyAddAction) |
| 27 | + SshPublicKeyAddAction, user_delegation_oid_validator) |
28 | 28 |
|
29 | 29 |
|
30 | 30 | def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statements, too-many-lines, too-many-branches, line-too-long |
@@ -961,6 +961,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
961 | 961 | 'specifies the blob snapshot to grant permission.') |
962 | 962 | c.extra('encryption_scope', help='A predefined encryption scope used to encrypt the data on the service.') |
963 | 963 | c.ignore('sas_token') |
| 964 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 965 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 966 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 967 | + 'to the user specified in this value.') |
964 | 968 |
|
965 | 969 | with self.argument_context('storage blob restore', resource_type=ResourceType.MGMT_STORAGE) as c: |
966 | 970 | from ._validators import BlobRangeAddAction |
@@ -1680,6 +1684,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
1680 | 1684 | "The expiry parameter and '--auth-mode login' are required if this argument is specified. ") |
1681 | 1685 | c.extra('encryption_scope', help='A predefined encryption scope used to encrypt the data on the service.') |
1682 | 1686 | c.ignore('sas_token') |
| 1687 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 1688 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 1689 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 1690 | + 'to the user specified in this value.') |
1683 | 1691 |
|
1684 | 1692 | for cmd in ['acquire', 'renew', 'break', 'change', 'release']: |
1685 | 1693 | with self.argument_context(f'storage container lease {cmd}') as c: |
@@ -1941,6 +1949,13 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
1941 | 1949 | help=sas_help.format(get_permission_help_string(t_share_permissions)), |
1942 | 1950 | validator=get_permission_validator(t_share_permissions)) |
1943 | 1951 | c.ignore('sas_token') |
| 1952 | + c.argument('as_user', action='store_true', validator=as_user_validator, is_preview=True, |
| 1953 | + help="Indicates that this command return the SAS signed with the user delegation key. " |
| 1954 | + "The expiry parameter and '--auth-mode login' are required if this argument is specified. ") |
| 1955 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 1956 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 1957 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 1958 | + 'to the user specified in this value.') |
1944 | 1959 |
|
1945 | 1960 | with self.argument_context('storage share update') as c: |
1946 | 1961 | c.extra('share_name', share_name_type, options_list=('--name', '-n'), required=True) |
@@ -2149,6 +2164,13 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
2149 | 2164 | c.extra('content_type', help='Response header value for Content-Type when resource is accessed ' |
2150 | 2165 | 'using this shared access signature.') |
2151 | 2166 | c.ignore('sas_token') |
| 2167 | + c.extra('as_user', action='store_true', validator=as_user_validator, is_preview=True, |
| 2168 | + help="Indicates that this command return the SAS signed with the user delegation key. " |
| 2169 | + "The expiry parameter and '--auth-mode login' are required if this argument is specified. ") |
| 2170 | + c.extra('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 2171 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 2172 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 2173 | + 'to the user specified in this value.') |
2152 | 2174 |
|
2153 | 2175 | with self.argument_context('storage file list') as c: |
2154 | 2176 | c.extra('share_name', share_name_type, required=True) |
@@ -2295,6 +2317,13 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
2295 | 2317 | help=sas_help.format(get_permission_help_string(t_queue_permissions)), |
2296 | 2318 | validator=get_permission_validator(t_queue_permissions)) |
2297 | 2319 | c.ignore('sas_token') |
| 2320 | + c.argument('as_user', action='store_true', validator=as_user_validator, is_preview=True, |
| 2321 | + help="Indicates that this command return the SAS signed with the user delegation key. " |
| 2322 | + "The expiry parameter and '--auth-mode login' are required if this argument is specified. ") |
| 2323 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 2324 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 2325 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 2326 | + 'to the user specified in this value.') |
2298 | 2327 |
|
2299 | 2328 | with self.argument_context('storage queue list') as c: |
2300 | 2329 | c.argument('include_metadata', help='Specify that queue metadata be returned in the response.') |
@@ -2540,6 +2569,10 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
2540 | 2569 | help='Indicate that this command return the full blob URI and the shared access signature token.') |
2541 | 2570 | c.argument('encryption_scope', help='Specify the encryption scope for a request made so that all ' |
2542 | 2571 | 'write operations will be service encrypted.') |
| 2572 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 2573 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 2574 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 2575 | + 'to the user specified in this value.') |
2543 | 2576 |
|
2544 | 2577 | with self.argument_context('storage fs list') as c: |
2545 | 2578 | c.argument('include_metadata', arg_type=get_three_state_flag(), |
@@ -2666,6 +2699,46 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem |
2666 | 2699 | help='Indicate that this command return the full blob URI and the shared access signature token.') |
2667 | 2700 | c.argument('encryption_scope', help='Specify the encryption scope for a request made so that all ' |
2668 | 2701 | 'write operations will be service encrypted.') |
| 2702 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 2703 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 2704 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 2705 | + 'to the user specified in this value.') |
| 2706 | + |
| 2707 | + with self.argument_context('storage fs file generate-sas') as c: |
| 2708 | + t_file_system_permissions = self.get_sdk('_models#FileSystemSasPermissions', |
| 2709 | + resource_type=ResourceType.DATA_STORAGE_FILEDATALAKE) |
| 2710 | + c.register_sas_arguments() |
| 2711 | + c.argument('file_system_name', options_list=['-f', '--file-system'], |
| 2712 | + help='File system name (i.e. container name).', required=True) |
| 2713 | + c.argument('path', options_list=['-p', '--path'], help="The file path in a file system.", required=True) |
| 2714 | + c.argument('id', options_list='--policy-name', |
| 2715 | + help='The name of a stored access policy.') |
| 2716 | + c.argument('permission', options_list='--permissions', |
| 2717 | + help=sas_help.format(get_permission_help_string(t_file_system_permissions)), |
| 2718 | + validator=get_permission_validator(t_file_system_permissions)) |
| 2719 | + c.argument('cache_control', help='Response header value for Cache-Control when resource is accessed' |
| 2720 | + 'using this shared access signature.') |
| 2721 | + c.argument('content_disposition', help='Response header value for Content-Disposition when resource is accessed' |
| 2722 | + 'using this shared access signature.') |
| 2723 | + c.argument('content_encoding', help='Response header value for Content-Encoding when resource is accessed' |
| 2724 | + 'using this shared access signature.') |
| 2725 | + c.argument('content_language', help='Response header value for Content-Language when resource is accessed' |
| 2726 | + 'using this shared access signature.') |
| 2727 | + c.argument('content_type', help='Response header value for Content-Type when resource is accessed' |
| 2728 | + 'using this shared access signature.') |
| 2729 | + c.argument('as_user', action='store_true', |
| 2730 | + validator=as_user_validator, |
| 2731 | + help="Indicates that this command return the SAS signed with the user delegation key. " |
| 2732 | + "The expiry parameter and '--auth-mode login' are required if this argument is specified. ") |
| 2733 | + c.ignore('sas_token') |
| 2734 | + c.argument('full_uri', action='store_true', |
| 2735 | + help='Indicate that this command return the full blob URI and the shared access signature token.') |
| 2736 | + c.argument('encryption_scope', help='Specify the encryption scope for a request made so that all ' |
| 2737 | + 'write operations will be service encrypted.') |
| 2738 | + c.argument('user_delegation_oid', validator=user_delegation_oid_validator, is_preview=True, |
| 2739 | + help='Specifies the Entra ID of the user that is authorized to use the resulting SAS URL. ' |
| 2740 | + 'The resulting SAS URL must be used in conjunction with an Entra ID token that has been issued ' |
| 2741 | + 'to the user specified in this value.') |
2669 | 2742 |
|
2670 | 2743 | with self.argument_context('storage fs file list') as c: |
2671 | 2744 | c.extra('file_system_name', options_list=['-f', '--file-system'], |
|
0 commit comments