Docs: AppSync identity docstring says OPENID_CONNECT returns None, but the dispatch has no such path
Mantenedores costumam responder em até 1 dia
Avaliação
Esta issue ainda não foi avaliada.
Descrição
What were you searching in the docs?
The identity property docstring on AppSyncEventBase (aws_lambda_powertools/utilities/data_classes/appsync_resolver_event.py), which is the reference for what object you get back per AppSync authorization mode.
Is this related to an existing documentation section?
How can we improve?
Two of the listed cases cannot be true as written, and they are still marked as unverified in the source.
get_identity_object only returns None when the identity mapping is None:
if identity is None:
return None
if "sub" in identity:
return AppSyncIdentityCognito(identity)
return AppSyncIdentityIAM(identity)
There is no path that yields None for a non-null identity. Yet the docstring says:
- AWS_LAMBDA authorization - returns None - NEED TO TEST
- OPENID_CONNECT authorization - returns None - NEED TO TEST
So each line can only hold if AppSync sends no identity object at all for that mode — which the code itself does not model, and which the two "NEED TO TEST" notes admit was never checked.
For OPENID_CONNECT specifically, AppSyncIdentityCognito exposes claims, issuer, groups and default_auth_strategy — those are the OIDC identity fields, so that class is already intended to serve OIDC events. Any OIDC identity carries sub, so it lands on AppSyncIdentityCognito, not on None.
I am deliberately not asserting what AWS_LAMBDA resolves to: its identity mapping is whatever the authorizer returns, there is no fixture for it here, and I have not verified it.
Got a suggestion in mind?
Two parts, both small:
- Correct the
OPENID_CONNECTline to state that it resolves toAppSyncIdentityCognito, and drop itsNEED TO TESTnote now that it is settled. - Add a test that pins the dispatch down — a non-null identity containing
subreturnsAppSyncIdentityCognito, a non-null identity withoutsubreturnsAppSyncIdentityIAM, and onlyNonereturnsNone— so the docstring and the behaviour cannot drift apart again.
I would leave the AWS_LAMBDA line as an open question rather than guess at it. Happy to open a PR if this is welcome.
Acknowledgment
- I understand the final update might be different from my proposed suggestion, or refused.
- Linguagem predominante
- Python
- Estrelas
- 3.3k
- Forks
- 511
- Merge médio
- 3d 8h
- PRs com merge (30d)
- 92
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o 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 aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationTalvez já em andamento @lechakrawarthy assumiu há 1 dia. Abertabug good first issue help wanted idempotency
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
aws-powertools/powertools-lambda-python#8728 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GETTalvez já em andamento @coughlmao assumiu há 1 dia. Abertabug good first issue help wanted idempotency
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
aws-powertools/powertools-lambda-python#8727 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 secondsTalvez já em andamento @CJstate assumiu há 1 dia. Abertabug good first issue help wanted idempotency
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
aws-powertools/powertools-lambda-python#8726 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashedTalvez já em andamento @Neeraj111010 assumiu há 1 dia. Abertabug good first issue help wanted idempotency
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
aws-powertools/powertools-lambda-python#8725 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valueTalvez já em andamento @sumedh-aerram assumiu há 1 dia. Abertabug good first issue help wanted idempotency
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
aws-powertools/powertools-lambda-python#8724 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de aws-powertools/powertools-lambda-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
huggingface/smolagents#3106 ·
Mantenedores costumam responder em até 2 dias
-
area:scripts area:tests bug priority:later
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Ikalus1988/MisakaNet#4358 ·
Mantenedores costumam responder em até 1 dia
-
Discovered ports from service discovery are never propagated to modules in Module.load()Talvez já em andamento @vishalmore90 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
OWASP/Nettacker#1828 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
aws-samples/sample-per-model-bedrock#708 ·
Mantenedores costumam responder em até 1 dia
-
maintenance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100