- Supported :
- http://openid.bitbucket.org/openid-connect-session-1_0.html
- Not Supported yet :
- discovery of OP iframe URL and logout URL
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 strategy = 'keycloak' | |
export default function ({ app }) { | |
const { $axios, $auth } = app | |
if (!$auth.loggedIn || !$auth.strategies[strategy]) | |
return | |
const options = $auth.strategies.keycloak.options |
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
require 'openssl' | |
key = OpenSSL::PKey::RSA.new(2048) | |
p encrypted_string = key.public_encrypt('my plaintext string', OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) | |
p decrypted_string = key.private_decrypt(encrypted_string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING) |
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
/** | |
* Returns SHA-256 hash from supplied message. | |
* | |
* @param {String} message. | |
* @returns {String} hash as hex string. | |
* | |
* @example | |
* sha256('abc').then(hash => console.log(hash)); | |
* const hash = await sha256('abc'); | |
*/ |
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
* Shows a message while asserting like: | |
ok: [host] => { | |
"msg": "disk usage 4.2B of total 20.0GB (21.0%) (should exceed limit 90.0%)" | |
} | |
* Note this only looks at first mount point on current node | |
* Fails if disk is near-full | |
* Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time | |
* Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size |
The idea is to provide a database as a service to end users in such a way that no one except the user herself can access the data, not even the hosting provider or the database administrator.
- A privacy- and/or security-conscious user will have more trust in such a setup.
- The service provider cannot be coerced to release the data they were trusted with, and he cannot be held responsible for the content he is storing.
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
// Get all users | |
var url = "http://localhost:8080/api/v1/users"; | |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', url, true) | |
xhr.onload = function () { | |
var users = JSON.parse(xhr.responseText); | |
if (xhr.readyState == 4 && xhr.status == "200") { | |
console.table(users); | |
} else { | |
console.error(users); |
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
# | |
# A: | |
# pubsub = PgPubSub.new('channelname') | |
# pubsub.subscribe do |data| | |
# puts "data: #{data} is coming!" | |
# end | |
# | |
# B: | |
# pubsub = PgPubSub.new('channelname') | |
# pubsub.publish("hello world") |
OlderNewer