Skip to content

Instantly share code, notes, and snippets.

View drucoder's full-sized avatar
😋
lets code right now!

Andrew drucoder

😋
lets code right now!
View GitHub Profile
@drucoder
drucoder / pom.xml
Created June 19, 2018 04:55
Lombok: пишем меньше кода
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
@drucoder
drucoder / build.gradle
Last active July 31, 2023 13:58
Sarafan: Add db support
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.postgresql:postgresql')
compile('org.projectlombok:lombok')
compile('javax.xml.bind:jaxb-api')
compile('com.sun.xml.bind:jaxb-core')
compile('com.sun.xml.bind:jaxb-impl')
@drucoder
drucoder / application.properties
Created July 20, 2018 04:29
Spring Boot REST: добавляем oAuth2 авторизацию
security.oauth2.client.clientId=some-secret.apps.googleusercontent.com
security.oauth2.client.clientSecret=very-secret
security.oauth2.client.accessTokenUri=https://www.googleapis.com/oauth2/v4/token
security.oauth2.client.userAuthorizationUri=https://accounts.google.com/o/oauth2/v2/auth
security.oauth2.client.clientAuthenticationScheme=form
security.oauth2.client.scope=openid,email,profile
security.oauth2.resource.userInfoUri=https://www.googleapis.com/oauth2/v3/userinfo
security.oauth2.resource.preferTokenInfo=true
server.port=9000
@drucoder
drucoder / build.gradle
Created July 20, 2018 04:30
Spring Boot REST: добавляем oAuth2 авторизацию (зависимости)
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.0.0.RELEASE')
@drucoder
drucoder / build.gradle
Created July 27, 2018 04:34
Spring Boot REST: добавляем oAuth2 авторизацию (зависимости) 2
compile('org.springframework.session:spring-session-jdbc')
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
@drucoder
drucoder / application.properties
Created July 27, 2018 04:36
Spring Boot REST: добавляем oAuth2 авторизацию 2
spring.session.jdbc.initialize-schema=always
spring.session.jdbc.table-name=SPRING_SESSION
spring.session.jdbc.schema=classpath:session_tables.sql
@drucoder
drucoder / session_tables.sql
Created July 27, 2018 04:37
Spring Boot REST: добавляем oAuth2 авторизацию (sessions table) 2
CREATE TABLE spring_session (
primary_id CHAR(36) NOT NULL
CONSTRAINT spring_session_pk
PRIMARY KEY,
session_id CHAR(36) NOT NULL,
creation_time BIGINT NOT NULL,
last_access_time BIGINT NOT NULL,
max_inactive_interval INTEGER NOT NULL,
expiry_time BIGINT NOT NULL,
principal_name VARCHAR(300) -- <= here was 100
@drucoder
drucoder / pom.xml
Last active April 20, 2020 15:02
Sprint boot MVC: интеграционные тесты - зависимости
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>RELEASE</version>
<scope>test</scope>
@drucoder
drucoder / webpack.config.js
Created September 6, 2018 17:01
Spring Boot REST: добавляем webpack
const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: path.join(__dirname, 'src', 'main', 'resources', 'static', 'js', 'main.js'),
devServer: {
contentBase: './dist',
compress: true,
@drucoder
drucoder / package.json
Created September 6, 2018 17:02
Spring Boot REST: добавляем webpack
{
"name": "sarafan",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"dependencies": {
"vue": "^2.5.17",
"vue-resource": "^1.5.1"
},
"devDependencies": {