This file contains 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
AWSTemplateFormatVersion: "2010-09-09" | |
Transform: AWS::Serverless-2016-10-31 | |
Description: "Stack to create signed URLs through API Gateway" | |
Parameters: | |
ImagesBucket: | |
Type: String | |
Description: Bucket name of the images | |
UrlExpire: | |
Type: Number | |
Description: Expire of signed image url in miliseconds |
This file contains 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
const AWS = require("aws-sdk"); | |
var fs = require('fs'); | |
exports.GetImage = async(event) => { | |
try { | |
let image = event['pathParameters']['img'] | |
let ImageKey = `${process.env.IMAGE_FOLDER}/${image}`; | |
const cloudfrontAccessKeyId = process.env.CLOUDFRONT_KEY_ID; |
This file contains 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
namespace dotnetJWT.Configuration | |
{ | |
public static class JwtConfiguration | |
{ | |
public static void ConfigureJwt(IServiceCollection services) | |
{ | |
services.AddAuthentication(configureOptions => | |
{ | |
configureOptions.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; | |
configureOptions.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; |
This file contains 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
version: "3" | |
services: | |
A servisi: | |
image: güzel_imaj | |
ports: | |
- lokalPort:containerPort | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost:15672"] |
This file contains 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
/* | |
Süpriz sonlu, konulu contract | |
*/ | |
pragma solidity ^0.4.19; | |
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; | |
contract HappyEnding is usingOraclize { | |
This file contains 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
contract SafeMath { | |
function safeAdd(uint a, uint b) public pure returns (uint c) { | |
c = a + b; | |
require(c >= a); | |
} | |
function safeSub(uint a, uint b) public pure returns (uint c) { | |
require(b <= a); | |
c = a - b; | |
} | |
function safeMul(uint a, uint b) public pure returns (uint c) { |
This file contains 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 UserDetailsServiceImpl implements UserDetailsService { | |
private DeveloperRepository developerRepository; | |
public UserDetailsServiceImpl(DeveloperRepository developerRepository) { | |
this.developerRepository = developerRepository; | |
} | |
@Override |
This file contains 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
@EnableWebSecurity | |
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | |
private UserDetailsService userDetailsService; | |
@Autowired | |
private BCryptPasswordEncoder bCryptPasswordEncoder; | |
public WebSecurityConfig(UserDetailsService userDetailsService, BCryptPasswordEncoder bCryptPasswordEncoder) { | |
this.userDetailsService = userDetailsService; | |
this.bCryptPasswordEncoder = bCryptPasswordEncoder; |
This file contains 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 class JWTAuthenticationFilter extends UsernamePasswordAuthenticationFilter { | |
private AuthenticationManager authenticationManager; | |
public JWTAuthenticationFilter(AuthenticationManager authenticationManager) { | |
this.authenticationManager = authenticationManager; | |
} | |
@Override |
This file contains 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 class SecurityConstants { | |
public static final String SECRET = "Emakina"; | |
public static final long EXPIRATION_TIME = 423_000_000; // 5 gün | |
public static final String TOKEN_PREFIX = "Bearer "; | |
public static final String HEADER_STRING = "Authorization"; | |
public static final String SIGN_UP_URL = "/developers/sign-up"; | |
} |
NewerOlder