graphql-python / graphql-python/flask-graphql

Best way to authenticate requests

Aberta
#17 7 comentários 5 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
1.3k
Forks
139
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I am trying to figure out the best way to authenticate a request before my schema executes the query/mutation. I was thinking I could use the @app.resolver('url') tag and create a function that would authenticate the request and then pass it to the graphqlview. Something like this:
```
@app.route('/graphql/')
def graphql():
print request.headers #AUTHENTICATE HERE
print request.data
return GraphQLView.as_view('/graphql/', schema=schema, graphiql=True)
```
But this doesn't work, can someone either show me what I am doing wrong here or give me a different way to authenticate the request? Thanks!

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Start with the Flask route using @app.route('/graphql/') and the GraphQLView.as_view('/graphql/', schema=schema, graphiql=True) entry point. Trace how the request reaches the schema, then establish an authentication approach that runs before schema execution and verify that unauthenticated requests are rejected.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
flask, graphql, python
Domínio
api, authentication, backend
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.