This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function run() | |
| { | |
| $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
| // Remove a pasta do projeto (caso esteja rodando em subpasta no Apache) | |
| $scriptDir = str_replace('/public', '', dirname($_SERVER['SCRIPT_NAME'])); | |
| if ($scriptDir !== '/') { | |
| $uri = str_replace($scriptDir, '', $uri); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace app\controllers; | |
| use app\core\Controller; | |
| class ArquivoController extends Controller | |
| { | |
| public function visualizar() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function somaDigitos($numero) | |
| { | |
| $soma = 0; | |
| while ($numero > 0) { | |
| $digito = $numero % 10; // pega o último dígito | |
| $soma += $digito; // soma o dígito | |
| $numero = $numero / 10; // remove o último dígito | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Mais Frases Criptografadas | |
| 1. N bn j mnblarycxpajorj mj yaógrvj vnwbjpnv nbcrena larycxpajojmj? | |
| 2. Hzn crffbn qb gvzr qrir ve, qvfpergnzragr, ngr b ynobengóevb znxre r crtne erpbzcrafn dhr rfgn fboer n zrfn.(2x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #spring.profiles.active=prod | |
| spring.datasource.url=jdbc:postgresql://dpg-d1hccdmr433s738rs3eg-a:5432/restlab | |
| spring.datasource.username=admin | |
| spring.datasource.password=I4OND2VYDnHjZh272zMevmW5jVyq37ni | |
| spring.jpa.hibernate.ddl-auto=update | |
| # ddl-auto: permite criação e atualização das tabelas do banco; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Service | |
| public class AuthenticationService { | |
| @Autowired | |
| JwtService jwtService; | |
| public String authenticate(Authentication authentication){ | |
| return jwtService.generateToken(authentication); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RestController | |
| public class AuthenticationResource { | |
| @Autowired | |
| private AuthenticationService authenticationService; | |
| @PostMapping("/authenticate") | |
| public String authenticate(Authentication authentication){ | |
| return authenticationService.authenticate(authentication); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- O hash abaixo corresponde à senha "123456" criptografada em BCrypt | |
| INSERT INTO user (username, password) VALUES ('admin', '$2a$10$Y50UaMFOxteibQEYofm72O39d.H5.fFhy.eZ3Xz3XyS/wGzVv1KWy'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -----BEGIN PUBLIC KEY----- | |
| MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3FlqJr5TRskIQIgdE3Dd | |
| 7D9lboWdcTUT8a+fJR7MAvQm7XXNoYkm3v7MQL1NYtDvL2l8CAnc0WdSTINU6IRv | |
| c5Kqo2Q4csNX9SHOmEfzoROjQqahEcve1jBXluoCXdYuYpx4/1tfRgG6ii4Uhxh6 | |
| iI8qNMJQX+fLfqhbfYfxBQVRPywBkAbIP4x1EAsbC6FSNmkhCxiMNqEgxaIpY8C2 | |
| kJdJ/ZIV+WW4noDdzpKqHcwmB8FsrumlVY/DNVvUSDIipiq9PbP4H99TXN1o746o | |
| RaNa07rq1hoCgMSSy+85SagCoxlmyE+D+of9SsMY8Ol9t0rdzpobBuhyJ/o5dfvj | |
| KwIDAQAB | |
| -----END PUBLIC KEY----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -----BEGIN PRIVATE KEY----- | |
| MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDcWWomvlNGyQhA | |
| iB0TcN3sP2VuhZ1xNRPxr58lHswC9Cbtdc2hiSbe/sxAvU1i0O8vaXwICdzRZ1JM | |
| g1TohG9zkqqjZDhyw1f1Ic6YR/OhE6NCpqERy97WMFeW6gJd1i5inHj/W19GAbqK | |
| LhSHGHqIjyo0wlBf58t+qFt9h/EFBVE/LAGQBsg/jHUQCxsLoVI2aSELGIw2oSDF | |
| oiljwLaQl0n9khX5ZbiegN3OkqodzCYHwWyu6aVVj8M1W9RIMiKmKr09s/gf31Nc | |
| 3WjvjqhFo1rTuurWGgKAxJLL7zlJqAKjGWbIT4P6h/1Kwxjw6X23St3OmhsG6HIn | |
| +jl1++MrAgMBAAECggEBAMf820wop3pyUOwI3aLcaH7YFx5VZMzvqJdNlvpg1jbE | |
| E2Sn66b1zPLNfOIxLcBG8x8r9Ody1Bi2Vsqc0/5o3KKfdgHvnxAB3Z3dPh2WCDek | |
| lCOVClEVoLzziTuuTdGO5/CWJXdWHcVzIjPxmK34eJXioiLaTYqN3XKqKMdpD0ZG |
NewerOlder