`InvalidModel` when updating Access Package Assignment Policy
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Commencez par assignment_policies.by_access_package_assignment_policy_id().get() et .put(), puis inspectez la sérialisation de AccessPackageAssignmentApprovalSettings et AccessPackageApprovalStage. Reproduisez le problème avec is_approval_required_for_add défini sur true et les étapes d’approbation fournies. C’est terminé lorsque la mise à jour de la stratégie existante réussit sans InvalidModel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
I want to update an access package assignment policy, but whenever the policy includes the requirement for approval (i.e. is_approval_required_for_add=True), this fails with an InvalidModel error.
Example:
If I set the property for "requires approval" to false, I am able to retrieve an existing access package policy by ID and update a certain property (e.g. the duration) successfully:
# Retrieve the pre-existing access package assignment policy:
ap_assignment_policy_obj = await graph_client.identity_governance.entitlement_management.assignment_policies.by_access_package_assignment_policy_id(<ap_pol_id>).get()
# Set the required duration in ISO 8601 duration format:
ap_assignment_policy_obj.expiration.duration = "PT4H"
# Update the access package assignment policy:
result = await graph_client.identity_governance.entitlement_management.assignment_policies.by_access_package_assignment_policy_id(<ap_pol_id>).put(ap_assignment_policy_obj)
However as soon as "requires approval" is set to true (and the associated approval groups etc. are set), I am no longer able to update an existing access package assignment policy. Instead, the following error is encountered:
msgraph.generated.models.o_data_errors.o_data_error.ODataError:
APIError
Code: 400
message: None
error: MainError(additional_data={}, code='InvalidModel', details=[], inner_error=InnerError(additional_data={}, client_request_id='', date=datetime.datetime(2025, 6, 12, 12, 57, 48), odata_type=None, request_id=''), message='The model is invalid.', target=None)
Expected behavior
Regardless of whether or not approval is required (as dictated by the property is_approval_required_for_add), the access package policy update should work.
How to reproduce
- Create an access package assignment policy
- Set "requires approval" to true, and fill in the required properties
- Try to update the access package assignment policy
SDK Version
1.33.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
msgraph.generated.models.o_data_errors.o_data_error.ODataError:
APIError
Code: 400
message: None
error: MainError(additional_data={}, code='InvalidModel', details=[], inner_error=InnerError(additional_data={}, client_request_id='', date=datetime.datetime(2025, 6, 12, 12, 57, 48), odata_type=None, request_id=''), message='The model is invalid.', target=None)
Configuration
No response
Other information
An example of the approval settings that can be used to generate this error is shown below:
from msgraph.generated.models.access_package_assignment_approval_settings import AccessPackageAssignmentApprovalSettings
from msgraph.generated.models.access_package_approval_stage import AccessPackageApprovalStage
ap_assignment_policy_obj. request_approval_settings = AccessPackageAssignmentApprovalSettings(
is_approval_required_for_add = True,
is_approval_required_for_update = False,
is_requestor_justification_required = True,
stages = [
AccessPackageApprovalStage(
duration_before_automatic_denial = datetime.timedelta(days=14),
is_escalation_enabled = False,
is_approver_justification_required = True,
duration_before_escalation = datetime.timedelta(0),
primary_approvers = [
GroupMembers(
odata_type = "#microsoft.graph.groupMembers",
description = "approver_group"
)
],
fallback_primary_approvers = [],
escalation_approvers = [],
fallback_escalation_approvers = []
)
]
)
- Langage dominant
- Python
- Étoiles
- 630
- Forks
- 96
- Merge moyen
- 15 h 20 min
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-sdk-python
-
status:waiting-for-triage type:bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 commentaires · 1 réaction ·
-
Batch Request Support Ouvertestatus:waiting-for-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
microsoftgraph/msgraph-sdk-python#1556 · 1 commentaire · 1 réaction ·
Toutes les issues de microsoftgraph/msgraph-sdk-python
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
zostera/django-bootstrap4#894 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
use-agent-os/agent-os#3276 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NousResearch/hermes-agent#117848 ·