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

7 feat login de usuário #6

Merged
merged 70 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9e9db76
chore: função de assinar o token criada
ItzTas Aug 13, 2024
0187769
chore: configdotenv configurado
ItzTas Aug 13, 2024
77057f8
chore: dependencias adicionadas
ItzTas Aug 13, 2024
7315b9c
chore: metodo login implementado
ItzTas Aug 13, 2024
0dddc86
test: começando a implementar testes para o user controller
ItzTas Aug 13, 2024
4937bb5
chore: começando função para truncar users
ItzTas Aug 13, 2024
1d92323
chore: adicao nas dependencias
MrErykCardoso Aug 14, 2024
3a72391
chore: configuracao do database
MrErykCardoso Aug 14, 2024
988b027
test: configuracao do teste de login
MrErykCardoso Aug 14, 2024
0d927a8
chore: configuracao de rota
MrErykCardoso Aug 14, 2024
2143d3f
chore: nome consertado
ItzTas Aug 14, 2024
4d90666
chore: compare password from hash função holder implementada
ItzTas Aug 14, 2024
fb2d691
chore: nome corrigido
ItzTas Aug 14, 2024
d438a51
test: implementação do teste para rota login
ItzTas Aug 14, 2024
5e7aa79
chore: get user by user name implementado
ItzTas Aug 14, 2024
a6d1769
chore: methodo de login começado
ItzTas Aug 14, 2024
b271488
chore: corrigindo erros de console do teste
MrErykCardoso Aug 16, 2024
8d78ed6
chore: helpers movidos
ItzTas Aug 16, 2024
5bdbcdb
chore: format object helper
ItzTas Aug 16, 2024
9c5e514
chore: moved
ItzTas Aug 16, 2024
b60e2c5
chore: moment adicionado
ItzTas Aug 16, 2024
d771f29
chore: console log removido
ItzTas Aug 16, 2024
83ef5be
chore: nada mudou
ItzTas Aug 16, 2024
1ad152a
feat: login de usuario
ItzTas Aug 16, 2024
6f5012b
chore: melhor entendimento de falha de teste
ItzTas Aug 16, 2024
ada0472
chore: jest setup realmente configurado
ItzTas Aug 16, 2024
a6d7c88
ci: adicionando docker compose
heyitsmepablo Aug 16, 2024
26fcc7b
ci: aplicando configurações
heyitsmepablo Aug 16, 2024
1bb2d8d
ci: configurando envs no workflow
heyitsmepablo Aug 16, 2024
171d617
ci: atualizando workflow
heyitsmepablo Aug 16, 2024
a0a1864
ci: ajustando workflow
heyitsmepablo Aug 16, 2024
4798593
ci : ajustando workflow
heyitsmepablo Aug 16, 2024
9f0b93a
ci: ajustando worflow
heyitsmepablo Aug 16, 2024
7eb4396
ci: ajustando workflow
heyitsmepablo Aug 16, 2024
54ce495
ci: ajustando workflow
heyitsmepablo Aug 16, 2024
206b0b8
ci: ainda ajustando workflow
heyitsmepablo Aug 16, 2024
873ce4d
ci ajustando workflow
heyitsmepablo Aug 16, 2024
816fe7a
ci: ajustando workflow
heyitsmepablo Aug 16, 2024
520b4d5
ci: ajustando worklow
heyitsmepablo Aug 16, 2024
8bb61ab
ci: ajustando workflow
heyitsmepablo Aug 16, 2024
97d8b67
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
edbe051
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
03a47f4
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
f6fefe4
test: erro 400 sem nome sem senha
MrErykCardoso Aug 17, 2024
b4929e5
chore: consertos gerais
ItzTas Aug 17, 2024
89157a4
test: teste erro 404 e 401
ItzTas Aug 17, 2024
b07f011
chore: comentario removido
ItzTas Aug 17, 2024
5745f4a
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
5ef18de
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
e314f9f
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
c2c7351
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
32bffe9
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
f962a3f
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
9f3cec8
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
3f94bd8
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
3c3a1e8
ci: ajustando workflow
heyitsmepablo Aug 17, 2024
1eac2a2
test: pequeno cheque faltante adicionado
ItzTas Aug 17, 2024
df885ba
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
74c4aa3
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
90306ff
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
1b8915a
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
dabf634
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
c6a8a5b
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
9db97b2
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
650f127
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
e18c8c0
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
505f846
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
2d7ed81
ci: ajustando workflow
heyitsmepablo Aug 18, 2024
114e281
ci: implementação do novo workflow em teste unitario
heyitsmepablo Aug 18, 2024
090569d
chore: correção de review
heyitsmepablo Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
name: Testes Unitarios

on: [push, pull_request]
env:
POSTGRES_USER: ${{vars.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{vars.POSTGRES_PASSWORD}}
POSTGRES_HOST: ${{vars.POSTGRES_HOST}}
POSTGRES_PORT: ${{vars.POSTGRES_PORT}}
POSTGRES_DATABASE: ${{vars.POSTGRES_DATABASE}}
JWT_SECRET: ${{secrets.JWT_SECRET}}


jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Verificação do Repositorio
uses: actions/[email protected]

- name: Iniciando Docker Compose
uses: hoverkraft-tech/[email protected]
with:
services: database
compose-file: ./docker-compose.yml

- name: Configurando Node.Js
uses: actions/[email protected]
with:
node-version: '20'

- name: Instalando Dependencias
run: npm clean-install

- name: Executando Testes
run: npm run test

env:
POSTGRES_HOST: ${{env.POSTGRES_HOST}}
POSTGRES_PORT: ${{env.POSTGRES_PORT}}
POSTGRES_USER: ${{env.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{env.POSTGRES_PASSWORD}}
POSTGRES_DATABASE: ${{env.POSTGRES_DATABASE}}
JWT_SECRET: ${{env.JWT_SECRET}}
11 changes: 6 additions & 5 deletions docker/postgres/projeto-final-ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ CREATE TABLE "follows" (
);

CREATE TABLE "users" (
"id" integer PRIMARY KEY,
"id" serial PRIMARY KEY,
"username" varchar NOT NULL,
"password" varchar NOT NULL,
"created_at" timestamp NOT NULL DEFAULT 'NOW()'
);

CREATE TABLE "posts" (
"id" integer PRIMARY KEY NOT NULL,
"id" serial PRIMARY KEY,
"title" varchar NOT NULL,
"body" text NOT NULL,
"user_id" integer NOT NULL,
Expand All @@ -21,8 +21,9 @@ CREATE TABLE "posts" (

COMMENT ON COLUMN "posts"."body" IS 'Content of the post';

ALTER TABLE "posts" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id");
ALTER TABLE "posts" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE;

ALTER TABLE "follows" ADD FOREIGN KEY ("following_user_id") REFERENCES "users" ("id");
ALTER TABLE "follows" ADD FOREIGN KEY ("following_user_id") REFERENCES "users" ("id") ON DELETE CASCADE;

ALTER TABLE "follows" ADD FOREIGN KEY ("followed_user_id") REFERENCES "users" ("id") ON DELETE CASCADE;

ALTER TABLE "follows" ADD FOREIGN KEY ("followed_user_id") REFERENCES "users" ("id");
Loading