UserType discrepancy between enum value and Graph API response
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia con l'enum generato Microsoft\Graph\Generated\Models\UserType e confronta il suo valore MEMBER con la risposta del user endpoint di Microsoft Graph mostrata nell'issue. Esamina le costanti degli altri enum dell'SDK per verificare la presenza dello stesso tipo di discrepanza. Il lavoro è completato quando UserType corrisponde all'API e ogni ulteriore discrepanza individuata è stata identificata e corretta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The following Microsoft Graph API endpoint:
https://graph.microsoft.com/v1.0/users/{{azureUserId}}?$select=userType
returns
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(userType)/$entity",
"userType": "Member"
}
However, the Microsoft\Graph\Generated\Models\UserType generated enum of the SDK contains
public const MEMBER = "member";
If an integration intends to proactively remove non-member type users from the system using code such as:
if ($azureUser->getUserType() !== UserType::MEMBER) {
$azureUser->delete();
}
this risks removing all Azure users from the system, because an Azure user of user type member would satisfy this condition as well ('member' !== 'Member' is true).
Note: This discrepancy between the API response and the generated SDK has triggered an incident in a production environment of a software product, because the unit tests use the UserType value from the SDK.
Expected behavior
The UserType enum/const should have values capitalized.
Any other enum/consts contained in the SDK should be reviewed for correctness to be in-line with the actual API responses.
How to reproduce
See issue description. There's discrepancy between the API response and the SDK enum/const value.
SDK Version
"microsoft/microsoft-graph": "^2.3",
Latest version known to work for scenario above?
None.
Known Workarounds
Not using UserType, hardcoding sentence-cased value.
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Lingua principale
- PHP
- Stelle
- 669
- Fork
- 149
- Merge medio
- 1g 4h
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-php
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 commenti ·
-
bug: metadata type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 commenti ·
-
status:waiting-for-triage type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 commenti · 4 reazioni ·
-
status:waiting-for-triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-php#1800 · 3 reazioni ·
-
NowAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
Tutte le issue di microsoftgraph/msgraph-sdk-php
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
matomo-org/plugin-CustomAlerts#310 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug Status: Needs Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
php/web-php#2102 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
domain/checkout Platform(Default) priority/low testing/acceptance
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
pluginsGLPI/addressing#132 ·
-
5.14.0 PIE packages still declare PHP >=8.3, so PIE installs them on PHP 8.3 and the build failsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100