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
import lo_ from 'lodash'; | |
import Duo from 'duo_web'; | |
// using lodash .get https://lodash.com/docs/4.16.2#get to access nested object properties safely | |
// get settings from Meteor settings.json | |
const duoSettings = lo_.get(Meteor, 'settings.services.duoSecurity', null); | |
if (!duoSettings) { | |
throw new Meteor.Error('err - Duo API settings.json not available'); | |
} |
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
<template name="loginAuthFrame"> | |
<div class="ui raised very padded text container segment"> | |
<iframe id="duo_iframe" frameborder="0"></iframe> | |
<style> | |
#duo_iframe { | |
width: 100%; | |
min-width: 304px; | |
max-width: 620px; | |
height: 330px; | |
} |
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
//refactor to your own app's layout/settings as needed. Using FlowRouter with Blaze Layout below. | |
FlowRouter.route('/auth', { | |
name: 'auth', | |
action: function(params, queryParams) { | |
BlazeLayout.render("mainLayout", { | |
content: "loginAuthFrame" | |
}); | |
} | |
}); |
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
//basic function to process the response from Duo and route to another page. Param will be the HTML form component. | |
const processSubmit = function(form) { | |
// check to ensure correct parameter format | |
check(form, Match.Where(x => { | |
return x.nodeName === 'FORM'; | |
})); | |
// get the input component from the form | |
const responseInput = form.elements.namedItem("sig_response"); | |
// get the value of the input | |
const sig_response = responseInput && responseInput.value; |
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
# Configuration for metric instances | |
apiVersion: "config.istio.io/v1alpha2" | |
kind: metric | |
metadata: | |
name: doublerequestcount | |
namespace: istio-system | |
spec: | |
value: "2" # count each request twice | |
dimensions: | |
source: source.service | "unknown" |
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
#!/bin/bash | |
# | |
# Checks Google Cloud container registry to see if build has finished deploying new image from source repository recent update. | |
# Retries 15 times, waiting 20 seconds between attempts. | |
# | |
DEPLOYMENT="$(basename -s .git `git config --get remote.origin.url`)" | |
PROJECT_ID="$(gcloud config get-value project)" | |
IMAGE_NAME="gcr.io/$(gcloud config get-value project)/$DEPLOYMENT:$(git rev-parse HEAD)" |
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
/////////////////// | |
// makeFieldList // | |
/////////////////// | |
const filterString = '_r' | |
const reg = new RegExp(`${filterString}$`) | |
/** | |
* @param {Object[]} fields The selectionSet selections array from the resolver info arg. | |
* @param {Object} [f={}] Fields object, used with recursive calls |
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
import React from 'react' | |
import { withRouter, Link } from 'react-router-dom' | |
import { graphql, compose } from 'react-apollo' | |
import { Formik } from 'formik' | |
import Yup from 'yup' | |
import FormWideError from '../elements/form/FormWideError' | |
import TextInput from '../elements/form/TextInput' | |
import Button from '../elements/form/Button' | |
import { H2 } from '../elements/text/Headings' |
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
class RLog { | |
contructor(title) { | |
this.kind = 'Method Log' | |
this.name = title | |
this.book = { | |
new: true, | |
errors: [], | |
successes: [], | |
errorCount: 0, | |
successCount: 0, |
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
#!/bin/bash | |
# | |
# Checks Google Cloud container registry to see if build has finished deploying new image from | |
# source repository recent update. "GCP" stands for "Google Cloud Platform" when used below. | |
# | |
# By default, retries 9 times, waiting 45 seconds between attempts. | |
# | |
# Configure the variables at the top of the file for your environment |
OlderNewer