sign_ins.get does not support the filter properties from Docs
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece pelo ponto de entrada gerado audit_logs/sign_ins/sign_ins_request_builder.py usado por SignInsRequestBuilder e inspecione como a solicitação GET constrói sua consulta de filtros. Compare a solicitação do SDK com a solicitação HTTP beta documentada usando os filtros de reprodução. Considera-se concluído quando os filtros signInEventTypes e servicePrincipalId forem aceitos por meio do Python SDK.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the bug
When attempting to get nonInteractiveUser and servicePrincipal sign-ins, we receive one the following error messages when we try to use the filter properties defined in the Official MSgraph Beta API documentation.
"Invalid filter clause: Could not find a property named 'servicePrincipalId' on type 'microsoft.graph.signIn'."
Invalid filter clause: Could not find a property named 'signInEventTypes' on type 'microsoft.graph.signIn'.", target=None)
Here are some example filters we have tried
filter_query = f"createdDateTime ge {start_time_str} and createdDateTime le {end_time_str} and signInEventTypes/any(t: t eq 'nonInteractiveUser' or t eq 'servicePrincipal')"
filter_query = "signInEventTypes/any(t: t eq 'nonInteractiveUser' or t eq 'servicePrincipal')"
filter_query = f"servicePrincipalId eq '{id}'"
Notes:
- This exact same code works fine via the Python Beta SDK if we only include the
createdDateTimeproperties in the filter - This exact same filter (including
signInEventTypes/anyproperty) works fine when used via the MSGraph Beta API over HTTP
Questions
- I understand this is a beta, but should we expect the Python SDK to behave differently from the Beta Docs and the Beta HTTP API?
Expected behavior
- The python beta SDK would support the same filter properties as documented in the MSGraph Beta API documentation
- The python beta SDK would support the same filter properties as the MSGraph Beta HTTP API
How to reproduce
import asyncio
import os
from azure.identity import InteractiveBrowserCredential
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.audit_logs.sign_ins.sign_ins_request_builder import (
SignInsRequestBuilder,
)
AZURE_TENANT_ID = os.environ.get("AZURE_TENANT_ID")
CERT = os.environ.get("CERT_PATH")
async def get_sign_ins(client):
"""Get sign-ins with SDK"""
filter_query = (
"signInEventTypes/any(t: t eq 'nonInteractiveUser' or t eq 'servicePrincipal')"
)
query_params = SignInsRequestBuilder.SignInsRequestBuilderGetQueryParameters(
filter=filter_query,
top=1,
)
request_configuration = RequestConfiguration(
query_parameters=query_params,
)
result = await client.audit_logs.sign_ins.get(
request_configuration=request_configuration
)
return result.value
async def main():
"""Main async function to process sign-ins"""
credential = InteractiveBrowserCredential(
tenant_id=AZURE_TENANT_ID, connection_verify=CERT
)
client = GraphServiceClient(
credential,
scopes=["https://graph.microsoft.com/.default"],
)
result = await get_sign_ins(client)
print(result)
if __name__ == "__main__":
asyncio.run(main())
SDK Version
1.31.0
Latest version known to work for scenario above?
No response
Known Workarounds
Use HTTP to hit beta API via python requests library
Debug output
"Invalid filter clause: Could not find a property named 'signInEventTypes' on type 'microsoft.graph.signIn'."
Configuration
- OS: macOS Sequoia 15.3.1
- Architecture: M1 ARM
Other information
No response
- Linguagem predominante
- Python
- Estrelas
- 44
- Forks
- 16
- Merge médio
- 20h 39min
- PRs com merge (30d)
- 3
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoftgraph/msgraph-beta-sdk-python
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
-
type:bug type:investigation
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
microsoftgraph/msgraph-beta-sdk-python#1033 · 1 reação ·
-
status:waiting-for-triage type:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 42/100
microsoftgraph/msgraph-beta-sdk-python#1006 · 1 comentário ·
-
status:waiting-for-triage type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 48/100
microsoftgraph/msgraph-beta-sdk-python#987 · 2 comentários ·
Todas as issues de microsoftgraph/msgraph-beta-sdk-python
Issues semelhantes
-
link-check link-check:sphinx-theme
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
OpenHands/extensions#626 · 1 comentário ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
CSCfi/sd-search-api#39 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100