Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/change account api endpoints #85

Merged
merged 38 commits into from Mar 22, 2019

Conversation

@daltonmatos
Copy link
Member

daltonmatos commented Mar 20, 2019

No description provided.

daltonmatos added 13 commits Mar 15, 2019
O código ainda está todo no handler e será movido para um UserService ou algo nessa linha.
Modelos que antes estavam em `hollowman.models.*` foram para `asgard.models.*`
Reirando imports de hollowman.models para modelo de Account
Agora a serialização da resposta é toda feita pelo Resource, que é uma classe do pydantic
Agora todod o código novo (inclusive os testes) usan o URL do banco vindo do settings que é pydantic:

from asgard.conf import settings

settings.DB_URL

Isso, em produção é populado pela URL ASGARD_DB_URL e em teste por TEST_DB_URL, de forma automática.
@daltonmatos daltonmatos requested a review from diogommartins as a code owner Mar 20, 2019
daltonmatos added 2 commits Mar 20, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 20, 2019

Codecov Report

Merging #85 into master will decrease coverage by 0.3%.
The diff coverage is 99.05%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #85      +/-   ##
========================================
- Coverage   95.31%    95%   -0.31%     
========================================
  Files          71     79       +8     
  Lines        1878   2022     +144     
========================================
+ Hits         1790   1921     +131     
- Misses         88    101      +13
Impacted Files Coverage Δ
hollowman/conf.py 100% <ø> (ø) ⬆️
hollowman/api/account.py 89.65% <ø> (-10.35%) ⬇️
asgard/handlers/http.py 0% <0%> (ø) ⬆️
asgard/api/users.py 100% <100%> (ø)
asgard/api/resources/users.py 100% <100%> (ø)
asgard/api/agents.py 79.41% <100%> (ø) ⬆️
asgard/db/__init__.py 100% <100%> (ø) ⬆️
asgard/models/account.py 100% <100%> (ø)
asgard/api/accounts.py 100% <100%> (ø)
hollowman/auth/__init__.py 100% <100%> (ø) ⬆️
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3617b25...75a4d05. Read the comment docs.

daltonmatos added 8 commits Mar 20, 2019
Agora que possível fazer queries que apenas querem saber se um detemrinado filtro retornaria algum registro
Agora recebe User e Account para gerar um novo token
Esse endpoint será re-implementado na api nova, async.
Esse endpoint é usado para fazer a troca de conta, retorna um novo token jwt para a conta desejada, de id={id}. Ou 403 caso não seja posspivel fazer a troca.
Todos os testes que antes usavam essa baseclass agora usam a baseclass
assíncrona e que já popula o banco de testes com alguns dados.
asgard/db/session.py Outdated Show resolved Hide resolved
daltonmatos added 3 commits Mar 21, 2019
Os testes de integração não estavam usando pool de conexões e isso
estava causando problemas pois o banco começava a recusar novas conexões
e os testes começavam a falhar
daltonmatos added 2 commits Mar 21, 2019
@daltonmatos daltonmatos requested a review from diogommartins Mar 21, 2019
conftest.py Outdated Show resolved Hide resolved
asgard/backends/users.py Outdated Show resolved Hide resolved
daltonmatos added 9 commits Mar 21, 2019
…/stop-using-hollowman-db-url
…e-account-api-endpoints
@daltonmatos daltonmatos merged commit 75a4d05 into master Mar 22, 2019
3 checks passed
3 checks passed
ci/circleci: test Your tests passed on CircleCI!
Details
codecov/patch 99.05% of diff hit (target 95.31%)
Details
codecov/project Absolute coverage decreased by -0.3% but relative coverage increased by +3.74% compared to 3617b25
Details
@daltonmatos daltonmatos deleted the feature/change-account-api-endpoints branch Mar 22, 2019
@daltonmatos daltonmatos added this to the 0.82.0 milestone Mar 22, 2019
@daltonmatos daltonmatos mentioned this pull request Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.