Skip to content

Instantly share code, notes, and snippets.

View gdestuynder's full-sized avatar
🏔️
.

Guillaume Destuynder (:kang) gdestuynder

🏔️
.
View GitHub Profile
curl 'https://wabi-us-gov-iowa-api.analysis.usgovcloudapi.net/public/reports/querydata?synchronous=true' \
--data-binary \
'{"version":"1.0.0","queries":[{"Query":{"Commands":[{"SemanticQueryDataShapeCommand":{"Query":{"Version":2,"From":[{"Name":"d1","Entity":"Deaths_Comorbidities"}],"Select":[{"Column":{"Expression":{"SourceRef":{"Source":"d1"}},"Property":"comorbidities"},"Name":"Deaths_Comorbidities.comorbidities"},{"Aggregation":{"Expression":{"Column":{"Expression":{"SourceRef":{"Source":"d1"}},"Property":"Total Cases"}},"Function":0},"Name":"Sum(Deaths_Comorbidities.Total Cases)"}],"OrderBy":[{"Direction":1,"Expression":{"Column":{"Expression":{"SourceRef":{"Source":"d1"}},"Property":"comorbidities"}}}]},"Binding":{"Primary":{"Groupings":[{"Projections":[0,1]}]},"DataReduction":{"DataVolume":4,"Primary":{"Window":{"Count":1000}}},"Version":1}}}]},"CacheKey":"{\"Commands\":[{\"SemanticQueryDataShapeCommand\":{\"Query\":{\"Version\":2,\"From\":[{\"Name\":\"d1\",\"Entity\":\"Deaths_Comorbidities\"}],\"S
" This file expects to have vim (yeh!), python-black, vim-jellybeans (it's a theme), exuberant-ctags, vim-plug installed (and to run PlugInstall the first time)
"General stuff
syntax on
set nocompatible
filetype off
set pastetoggle=<F2> "paste mode shortcut
set cursorline cursorcolumn "crosshair where cursor is
set nobackup nowritebackup noswapfile autoread "no cruft.
curl --request POST \
--url https://auth-dev.mozilla.auth0.com/oauth/token \
--header 'content-type: application/json' \
--data '{"client_id":"ID","client_secret":"SECRET","audience":"https://manage-dev.mozilla.auth0.com/api/session_testing","grant_type":"client_credentials", "scope": "test"}'
Result if `test` exists and is granted to your client id:
{"access_token":"SECRET","expires_in":86400,"token_type":"Bearer"}
If not:
var request = require("request");
// Exchange credentials for a temporary access token (valid 1h)
var options = { method: 'POST',
url: 'https://auth.mozilla.auth0.com/oauth/token',
headers: { 'content-type': 'application/json' },
body: '{"client_id":"CLIENT ID GOES HERE","client_secret":"SECRET GOES HERE","audience":"api.sso.mozilla.com","grant_type":"client_credentials"}' };
request(options, function (error, response, token) {
if (error) throw new Error(error);
var express = require('express');
var app = express();
var jwt = require('express-jwt');
var jwks = require('jwks-rsa');
var port = process.env.PORT || 8080;
var jwtCheck = jwt({
secret: jwks.expressJwtSecret({
cache: true,
AWSTemplateFormatVersion: 2010-09-09
Description: User that can trigger serverles.com lambda functions, meant for auth0 rules-hooks
Parameters:
PublisherFunctionArn:
Type: String
Description: The publisher function ARM
Default: arn:aws:lambda:us-west-2:320464205386:function:auth0-publisher-dev-handler
Resources:
AZRunnerRole:
Type: AWS::IAM::Role
diff --git a/demos/simple-v2/index.php b/demos/simple-v2/index.php
index bbb7d96..74691c4 100644
--- a/demos/simple-v2/index.php
+++ b/demos/simple-v2/index.php
@@ -4,7 +4,7 @@ require_once '../../vendor/autoload.php';
-const IKEY = '';
+const IKEY = 'REDACTED';
-const SKEY = '';
+const SKEY = 'REDACTED';
-const AKEY = '';
diff --git a/demos/simple-v3/server.js b/demos/simple-v3/server.js [0/1847]
index e442ecf..a9d9d7a 100644
--- a/demos/simple-v3/server.js
+++ b/demos/simple-v3/server.js
@@ -6,10 +6,10 @@ let qs = require('querystring')
let duo_web = require('../../index.js')
let {Frame} = require('@duosecurity/duo_api/lib/Frame')
-const IKEY = ''
-const SKEY = ''
-const AKEY = ''
function(access_token, ctx, callback) {
request.get('https://bugzilla.allizom.org/api/user/profile', {
'headers': {
'Authorization': 'Bearer ' + access_token,
'User-Agent': 'Auth0'
}
}, function(e, r, b) {
if (e) {
return callback(e);
}
--- a/python-modules/cis_publisher/cis_publisher/publisher.py
+++ b/python-modules/cis_publisher/cis_publisher/publisher.py
@@ -129,6 +129,9 @@ class Publish:
else:
user_id = profile.user_id.value
+ # Fixups and cleanups
+ self.filter_profiles_cleanup(profiles=[profile])
+
# Filter out non-updatable attributes as needed
self.filter_known_cis_users(profiles=[profile])