Authorization and Authentication are hard. when you only have to implement them once (as you do within a monolith) instead of over and over again, it makes the developer happy :-), and maybe leads to less implementation failures.
When you have a bunch of microservices, this is something that has to be considered.
Implement it once or in every microservice, or something in between?
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
from django.utils.http import urlencode | |
def reverse_querystring(view, urlconf=None, args=None, kwargs=None, current_app=None, query_kwargs=None): | |
'''Custom reverse to handle query strings. | |
Usage: | |
reverse_querystring('app.views.my_view', kwargs={'pk': 123}, query_kwargs={'search': 'Bob'}) | |
''' | |
base_url = reverse(view, urlconf=urlconf, args=args, kwargs=kwargs, current_app=current_app) | |
if query_kwargs: | |
return '{}?{}'.format(base_url, urlencode(query_kwargs)) |
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
{ | |
"clientId": "slack", | |
"surrogateAuthRequired": false, | |
"enabled": true, | |
"alwaysDisplayInConsole": false, | |
"clientAuthenticatorType": "client-secret", | |
"redirectUris": [ | |
"https://slack.com/", | |
"https://slack.com/*" | |
], |
Aerobase | Keycloak | WSO2 Identity Server | Gluu | CAS | OpenAM | Shibboleth IdP | |
---|---|---|---|---|---|---|---|
OpenID Connect/OAuth support | yes | yes | yes | yes | yes | yes | third-party |
Multi-factor authentication | yes | yes | yes | yes | yes | yes | yes |
Admin UI | yes | yes | yes | yes | yes | yes | no |
OpenJDK support | yes | yes | yes | yes | no | ||
Identity brokering | yes | yes | yes | ||||
Middleware | NGINX, Wildfly | Wildfly, JBOSS | WSO2 Carbon | Jetty, Apache HTTPD | any Java app server | any Java app server | Jetty, Tomc |
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
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |' | |
# noinspection PyPep8 | |
# noinspection PyPep8Naming | |
# noinspection PyTypeChecker | |
# noinspection PyAbstractClass | |
# noinspection PyArgumentEqualDefault | |
# noinspection PyArgumentList | |
# noinspection PyAssignmentToLoopOrWithParameter | |
# noinspection PyAttributeOutsideInit |
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
// https://stackoverflow.com/a/30256880/538284 | |
// https://stackoverflow.com/a/42241730/538284 | |
// https://stackoverflow.com/a/38082715/538284 | |
import android.content.Context; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.TypedValue; | |
public class GridAutoFitLayoutManager extends GridLayoutManager { |
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
View.OnTouchListener detectClickAndHoldListener = new View.OnTouchListener() { | |
private Timer timer = new Timer(); | |
private long LONG_PRESS_TIMEOUT = 1337; // TODO: your timeout here | |
private boolean wasLong = false; | |
@Override | |
public boolean onTouch(View v, MotionEvent event) { | |
Log.d(getClass().getName(), "touch event: " + event.toString()); |
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
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
import random |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans.xsd"> | |
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"> | |
<property name="dataStorageConfiguration"> |
NewerOlder