Skip to content

Commit

Permalink
Merge pull request #1111 from SEKOIA-IO/fix/azureaction
Browse files Browse the repository at this point in the history
Change the result type
  • Loading branch information
TOUFIKIzakarya authored Sep 27, 2024
2 parents 96b49aa + 9cc6cb1 commit a99fdb0
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 87 deletions.
6 changes: 6 additions & 0 deletions MicrosoftEntraID/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 2024-09-25 - 2.8.4

### Fixed

- Change result to dict

## 2024-09-25 - 2.8.3

### Fixed
Expand Down
174 changes: 90 additions & 84 deletions MicrosoftEntraID/action_get_user_authentication_methods.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,91 +16,97 @@
},
"results": {
"title": "GetUserAuthenticationMethodsResults",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"userPrincipalName": {
"title": "Userprincipalname",
"type": "string"
},
"userDisplayName": {
"title": "Userdisplayname",
"type": "string"
},
"userType": {
"title": "Usertype",
"type": "string"
},
"isAdmin": {
"title": "Isadmin",
"type": "boolean"
},
"isSsprRegistered": {
"title": "Isssprregistered",
"type": "boolean"
},
"isSsprEnabled": {
"title": "Isssprenabled",
"type": "boolean"
},
"isSsprCapable": {
"title": "Isssprcapable",
"type": "boolean"
},
"isMfaRegistered": {
"title": "Ismfaregistered",
"type": "boolean"
},
"isMfaCapable": {
"title": "Ismfacapable",
"type": "boolean"
},
"isPasswordlessCapable": {
"title": "Ispasswordlesscapable",
"type": "boolean"
},
"methodsRegistered": {
"title": "Methodsregistered",
"type": "array",
"items": {
"type": "string"
}
},
"isSystemPreferredAuthenticationMethodEnabled": {
"title": "Issystempreferredauthenticationmethodenabled",
"type": "boolean"
},
"systemPreferredAuthenticationMethods": {
"title": "Systempreferredauthenticationmethods",
"type": "array",
"items": {
"type": "string"
}
},
"userPreferredMethodForSecondaryAuthentication": {
"title": "Userpreferredmethodforsecondaryauthentication",
"type": "string"
},
"lastUpdatedDateTime": {
"title": "Lastupdateddatetime",
"type": "string"
"type": "object",
"properties": {
"authenticationResults": {
"title": "Authentication results",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"userPrincipalName": {
"title": "Userprincipalname",
"type": "string"
},
"userDisplayName": {
"title": "Userdisplayname",
"type": "string"
},
"userType": {
"title": "Usertype",
"type": "string"
},
"isAdmin": {
"title": "Isadmin",
"type": "boolean"
},
"isSsprRegistered": {
"title": "Isssprregistered",
"type": "boolean"
},
"isSsprEnabled": {
"title": "Isssprenabled",
"type": "boolean"
},
"isSsprCapable": {
"title": "Isssprcapable",
"type": "boolean"
},
"isMfaRegistered": {
"title": "Ismfaregistered",
"type": "boolean"
},
"isMfaCapable": {
"title": "Ismfacapable",
"type": "boolean"
},
"isPasswordlessCapable": {
"title": "Ispasswordlesscapable",
"type": "boolean"
},
"methodsRegistered": {
"title": "Methodsregistered",
"type": "array",
"items": {
"type": "string"
}
},
"isSystemPreferredAuthenticationMethodEnabled": {
"title": "Issystempreferredauthenticationmethodenabled",
"type": "boolean"
},
"systemPreferredAuthenticationMethods": {
"title": "Systempreferredauthenticationmethods",
"type": "array",
"items": {
"type": "string"
}
},
"userPreferredMethodForSecondaryAuthentication": {
"title": "Userpreferredmethodforsecondaryauthentication",
"type": "string"
},
"lastUpdatedDateTime": {
"title": "Lastupdateddatetime",
"type": "string"
}
},
"required": [
"id",
"userPrincipalName",
"isSsprRegistered",
"isSsprEnabled",
"isSsprCapable",
"isMfaRegistered",
"isMfaCapable",
"isPasswordlessCapable"
]
}
},
"required": [
"id",
"userPrincipalName",
"isSsprRegistered",
"isSsprEnabled",
"isSsprCapable",
"isMfaRegistered",
"isMfaCapable",
"isPasswordlessCapable"
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ async def run(self, arguments):
response = await self.query_user_auth_methods(request_configuration)
response.raise_for_status()

return response.json().get("value")
return {"authenticationResults": response.json().get("value")}
2 changes: 1 addition & 1 deletion MicrosoftEntraID/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"name": "Microsoft Entra ID",
"uuid": "3abf7928-65ef-4a5f-ba3e-5fbe56123d0c",
"slug": "azure-ad",
"version": "2.8.3",
"version": "2.8.4",
"categories": [
"IAM"
]
Expand Down
4 changes: 3 additions & 1 deletion MicrosoftEntraID/tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ async def test_get_user_authentication_methods():
}
]

final_value_expected = {"authenticationResults": value_expected}

response = requests.Response()
response._content = json.dumps(expected).encode("utf-8")
response.status_code = 200
Expand All @@ -170,7 +172,7 @@ async def test_get_user_authentication_methods():
):
results = await action.run({"userPrincipalName": "[email protected]"})

assert results == value_expected
assert results == final_value_expected


SIGN_INS: list[dict] = [
Expand Down

0 comments on commit a99fdb0

Please sign in to comment.