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

Commit patch para avaliar via PR diferencas #13108

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

#mock-api-runtime
*.jar

#sonar
.scannerwork

# User-specific files
*.suo
*.user
Expand Down
15 changes: 11 additions & 4 deletions SME.SGP.Api.Teste/Controllers/PermissionamentoControllerTeste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using SME.SGP.Api.Controllers;
using Xunit;

namespace SME.SGP.Api.Teste.Controllers
Expand All @@ -27,8 +29,11 @@ public async Task Verificar_Se_Existe_Permissao_Ou_AllowAnonymou_Authorize_Contr

ObterDadosControllers(listaApiMethod, apiControllers, AssemblyName);

var listMetodos = listaApiMethod.Where(x => x.CustomAttributeName.Count == 0);
var semAuthorizeAttribute = listaApiMethod.Where(x => x.Authorize ==false);

//o ideal seria olhar pelo atributo [AllowAnonymous] para criterio de exclusao
var exclusions = new []{nameof(VersaoController)};
var listMetodos = listaApiMethod.Where(x => x.CustomAttributeName.Count == 0 && !exclusions.Contains(x.ControllerName));
var semAuthorizeAttribute = listaApiMethod.Where(x => x.Authorize ==false && !exclusions.Contains(x.ControllerName));
var listAutorizecontrollerName = semAuthorizeAttribute.GroupBy(x => x.ControllerName).ToList();
var listcontrollerName = listMetodos.GroupBy(c => c.ControllerName).ToList();

Expand All @@ -44,8 +49,10 @@ public async Task Verificar_Se_Existe_Permissao_Ou_AllowAnonymou_Authorize_Contr

ObterDadosControllers(listaApiMethod, apiControllers, AssemblyName);

var listMetodos = listaApiMethod.Where(x => x.CustomAttributeName.Count == 0);
var semAuthorizeAttribute = listaApiMethod.Where(x => x.Authorize == false);
//o ideal seria olhar pelo atributo [AllowAnonymous] para criterio de exclusao
var exclusions = new []{nameof(VersaoController)};
var listMetodos = listaApiMethod.Where(x => x.CustomAttributeName.Count == 0 && !exclusions.Contains(x.ControllerName));
var semAuthorizeAttribute = listaApiMethod.Where(x => x.Authorize == false && !exclusions.Contains(x.ControllerName));
var listAutorizecontrollerName = semAuthorizeAttribute.GroupBy(x => x.ControllerName).ToList();
var listcontrollerName = listMetodos.GroupBy(c => c.ControllerName).ToList();

Expand Down
2 changes: 1 addition & 1 deletion SME.SGP.Api.Teste/SME.SGP.Api.Teste.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>

<SonarQubeTestProject>true</SonarQubeTestProject>
<IsPackable>false</IsPackable>

<UserSecretsId>bf27baf5-fe9e-4489-8f4e-5234401470bd</UserSecretsId>
Expand Down
61 changes: 61 additions & 0 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: "3.1"
services:
sme-db:
container_name: sme-db
restart: always
image: postgres:11-alpine
ports:
- "5433:5432"
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sgp_db
deploy:
resources:
limits:
cpus: "4"
memory: 10g
reservations:
cpus: "4"
memory: 10g
networks:
- sme-network
sme-flyway:
container_name: sme-flyway
restart: on-failure
image: boxfuse/flyway:5.2.4
command: migrate -locations='filesystem:/opt/scripts' -url='jdbc:postgresql://sme-db:5432/sgp_db?user=postgres&password=postgres' -outOfOrder=true
volumes:
- ./scripts:/opt/scripts
depends_on:
- sme-db
networks:
- sme-network
sme-rabbitmq:
container_name: sme-rabbitmq
image: rabbitmq:3.10.6-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=rabbitmq
- RABBITMQ_DEFAULT_PASS=rabbitmq
deploy:
resources:
limits:
cpus: "4"
memory: 10g
reservations:
cpus: "4"
memory: 10g
ports:
- "5673:5672"
- "15673:15672"
networks:
- sme-network
networks:
sme-network:
driver: bridge

# insert into ue (nome,data_atualizacao) values ('ue1',now());
# insert into tipo_calendario (nome,ano_letivo,periodo,modalidade,criado_em,criado_por,criado_rf) values ('Calendario 1',2022,1,1,now(),1,1);
# insert into aula (ue_id,disciplina_id,turma_id,tipo_calendario_id,professor_rf,quantidade,data_aula,recorrencia_aula,tipo_aula,criado_em,criado_por,criado_rf)
# values (1,1,1,1,'prof1',1,now(),'1','1',now(),now(),'admin');
# insert into diario_bordo (aula_id,planejamento,criado_em,criado_por,criado_rf) values (1,'sd',now(),1,1);
# insert into diario_bordo_observacao (diario_bordo_id,observacao,criado_em,criado_por,criado_rf,usuario_id) values (1,'sd',now(),1,1,1);
8 changes: 8 additions & 0 deletions mocks/apm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- method: POST
path: /apm/intake/v2/events
features:
delay: 0
response:
status: 200
body:
message: "ok"
Loading