Skip to content

Instantly share code, notes, and snippets.

View wtsiamruk's full-sized avatar
🏠
Working from home

Waldemar Tsiamruk wtsiamruk

🏠
Working from home
View GitHub Profile
@wtsiamruk
wtsiamruk / AnnotationClassMapBuilder.java
Created June 27, 2019 09:14 — forked from elaatifi/AnnotationClassMapBuilder.java
Example of a class-map builder supporting custom annotations to configure Orika mapper.
/*
AnnotationClassMapBuilder extends the default class map builder and override byDefault method to lookup for more metadata
*/
public class AnnotationClassMapBuilder<A, B> extends ClassMapBuilder<A, B> {
protected AnnotationClassMapBuilder(Type<A> aType, Type<B> bType, PropertyResolverStrategy propertyResolver,
DefaultFieldMapper[] defaults) {
super(aType, bType, propertyResolver, defaults);
}
@wtsiamruk
wtsiamruk / checkpoint-snx-vpn-client-fedora25.txt
Created April 12, 2019 13:34 — forked from rafaeltuelho/checkpoint-snx-vpn-client-fedora25.txt
setup Checkpoint Firewall VPN with SNX on Linux Fedora 25
First you have to ensure the Java JRE is installed on your system.
Remember the java plugin will only work on Firefox. If you prefer to install from fedora/rhel repos:
sudo dnf (yum) install java-1.8.0-openjdk icedtea-web
download the snx script installer from the Checkpoint VPN page:
https://<your company vpn ip addr>/sslvpn/SNX/INSTALL/snx_install.sh
run int as root to install
@wtsiamruk
wtsiamruk / multiple_ssh_setting.md
Created April 5, 2019 18:30 — forked from AtulKsol/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@wtsiamruk
wtsiamruk / tokens.md
Created March 19, 2019 18:12 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с данными сохранёнными в базе данных.

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.

Например после аутентификации юзер sasha получает право обращатся и получать от ресурса "super.com/vip" некие данные. Во время обращения юзера sasha к ресурсу vip система авторизации проверит имеет ли право юзер обращатся к этому ресурсу (проще говоря переходить по неким разрешенным ссылкам)