Skip to content

Instantly share code, notes, and snippets.

View ozten's full-sized avatar

Austin King ozten

View GitHub Profile
@ozten
ozten / production.json
Created January 4, 2013 19:30
How to add proxy_idps to production.json
{
"env": "production",
"bind_to": {
"host": "127.0.0.1"
},
"use_minified_resources": true,
"public_static_url": "https://static.login.persona.org",
"database": {
"driver": "mysql",
@ozten
ozten / socket.io-client.js
Created December 15, 2012 00:05
Connect to Socket.io from express code
// At the top of routes.js
var io = require('socket.io-client');
// Later
socket = io.connect('http://localhost:9714', {headers: {'X-express-to-socket-password': 'some secret string'}});
//or
socket = io.connect('http://localhost:9714', {'query': 'express-to-socket-password=some secret string'});
@ozten
ozten / rest_discussion.js
Created October 3, 2012 20:06
REST Discussion
Problem I use a CLI to start a build on jenkins.mozilla.org, which is password authenticated
and requires me to be [email protected]
Example Usage:
$ ./start-build.js [email protected] --project=mozilla/browserid --branch=train-2012-04-12
Password: 324klj234kl3j4
Build Success, 42 unit tests passed, rpm built, have a nice day
$
Hi folks.. I'm pretty sure everyone involved in Persona ops already
knows about this, but I figured I'd send it to services-ops just to be
completely sure.
My "expire-session" changes[1] finally landed on the master "dev" branch
last friday (10-Aug-2012)[2], and are scheduled to be included in the
branch we'll cut next friday (train-2012.08.17, I think), which should
turn into our Beta1 offering.
This feature includes a schema change, which adds a `lastPasswordReset`
CREATE TABLE IF NOT EXISTS user (id BIGINT AUTO_INCREMENT PRIMARY KEY,passwd CHAR(64),lastPasswordReset TIMESTAMP DEFAULT 0 NOT NULL) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS email (id BIGINT AUTO_INCREMENT PRIMARY KEY,user BIGINT NOT NULL,address VARCHAR(255) UNIQUE NOT NULL,type ENUM('secondary', 'primary') DEFAULT 'secondary' NOT NULL,verified BOOLEAN DEFAULT TRUE NOT NULL, FOREIGN KEY user_fkey (user) REFERENCES user(id)) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS staged (id BIGINT AUTO_INCREMENT PRIMARY KEY,secret CHAR(48) UNIQUE NOT NULL,new_acct BOOL NOT NULL,existing_user BIGINT,email VARCHAR(255) UNIQUE NOT NULL,passwd CHAR(64),ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,FOREIGN KEY existing_user_fkey (existing_user) REFERENCES user(id)) ENGINE=InnoDB;
@ozten
ozten / tmp.js
Created August 15, 2012 18:57
A quick `node tmp.js` for printing out the schema
// If you change these schemas, please notify <[email protected]>
const schemas = [
"CREATE TABLE IF NOT EXISTS user (" +
"id BIGINT AUTO_INCREMENT PRIMARY KEY," +
"passwd CHAR(64)," +
"lastPasswordReset TIMESTAMP DEFAULT 0 NOT NULL" +
") ENGINE=InnoDB;",
"CREATE TABLE IF NOT EXISTS email (" +
"id BIGINT AUTO_INCREMENT PRIMARY KEY," +
navigator.id.completeAuthentication({
“id”: <identifier>,
“limitedToRPs”: [“https://pay.bluevia.com”, “https://marketplace.mozilla.org”]
});
@ozten
ozten / login.persona.org.har
Created August 2, 2012 00:09
production hostedpersona.me error
{
"log": {
"version": "1.1",
"creator": {
"name": "Firebug",
"version": "1.10"
},
"browser": {
"name": "Firefox",
"version": "16.0a2"
@ozten
ozten / login.anosrep.org.har
Created August 2, 2012 00:06
stage hostedpersona.me error
{
"log": {
"version": "1.1",
"creator": {
"name": "Firebug",
"version": "1.10"
},
"browser": {
"name": "Firefox",
"version": "16.0a2"
@ozten
ozten / extract_public_key.js
Created July 16, 2012 20:20
Get public key or other fields from a cert
/*
cd into directory with root.cert
node extract_public_key.js
*/
var fs = require('fs');
cert = fs.readFileSync('root.cert').toString('utf8');
var pkEnc = cert.split('.')[1]