Skip to content

Instantly share code, notes, and snippets.

View jeffdeville's full-sized avatar

Jeff Deville jeffdeville

View GitHub Profile
@jeffdeville
jeffdeville / retrieveInvoiceRequest.xml
Created August 11, 2014 19:35
retrieveInvoice issues
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.sungard.com/bsil/acctmgmt/v1-0" xmlns:v11="http://www.sungard.com/ws/v1-0">
<soapenv:Header/>
<soapenv:Body>
<v1:retrieveInvoiceRequest>
<v11:client>
<!--Optional:-->
<v11:systemId>?</v11:systemId>
<!--Optional:-->
<v11:userRole>?</v11:userRole>
<v11:userId>?</v11:userId>
@jeffdeville
jeffdeville / console_router.rb
Last active August 29, 2015 14:03
A demo of how a console router might work
module Models
class Inventory
def self.all
[Object.new]
end
def self.find(inventory_id)
Object.new
end
end
end
@jeffdeville
jeffdeville / README.markdown
Last active August 29, 2015 14:02
PoC for logging - see Readme for explanation

Problems

  • We have a lot of logging-gems. log4r, logging, lograge, log4r-gelf, graylog2_exceptions. I thought that I'd moved things from logging -> log4r, but it turns out that some of the logging was still going through the logging gem, meaning my configuration was imperfect.
  • Additionally, virtually every gem requires some compatible configuration
  • The mechanism we were using to inject tracing data was forcing all logging traffic to be sent at the same 'level' (INFO)
  • Passing loggers in was a haphazard business of basically passing Procs around, if we wanted to get tracing added. It wasn't very flexible.

Solution

Gems

Tasks:

  • Create a proxy ala sorcery that will:
  • Omniauth config:
    • point to the made-up-endpoint
@jeffdeville
jeffdeville / omniauth_init.rb
Created April 18, 2014 19:51
sso config - bacchus
developer_provider = ENV["SSO_SIMULATOR"] == "true"
ENV['DEFAULT_OMNIAUTH_PROVIDER'] = developer_provider ? 'developer' : 'openid_connect'
Rails.application.config.middleware.use OmniAuth::Builder do
provider :openid_connect, ENV['OPEN_ID_IDENTIFIER'],
"e127441e7ae57a15ff5417f3b6dc5374",
"5b7c4ba0f2a116ba823329cd1ceb08998efbf9e5fb279f7ae759e708272f9d89",
{
name: :osstools,
client_options: {
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.sungard.com/bsil/appuser/v1-0" xmlns:v11="http://www.sungard.com/ws/v1-0" xmlns:v12="http://www.sungard.com/common/v1-0">
<soapenv:Header/>
<soapenv:Body>
<v1:createApplicationUserRequest>
<v11:client>
<v11:userId>?</v11:userId>
<v11:userApplicationDN>?</v11:userApplicationDN>
</v11:client>
<v1:acountNumber>e3358403-d56a-4721-bac0-25bb0ca7529f</v1:acountNumber>
<v1:productLineDesignator>CLOUD</v1:productLineDesignator>
class CreateWorkplaceWorkflow
include Workflow::Driver
include Workflow::Notifiable
attr_accessor :state, :cs_project, :bsil_workplace, :account_id
def initialize()
initialize_steps(step_arr)
end
def prepare(account_id, project_params, cs_project_service, bsil_workplace_service, bsil_workplace_notification_service)
@jeffdeville
jeffdeville / setCloudAccountDomainRequest.xml
Created March 24, 2014 19:10
Working with setCloudAccountDomain
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.sungard.com/bsil/cloud/v1-0" xmlns:v11="http://www.sungard.com/ws/v1-0" xmlns:v12="http://www.sungard.com/cloud/v1-0">
<soapenv:Header/>
<soapenv:Body>
<v1:setCloudAccountDomainRequest>
<v1:accountNumber>a436e845-6bec-4bb9-b100-4e3e586ec84f</v1:accountNumber>
<v1:version>10</v1:version>
<v1:domain>
<v12:csId>a436e845-6bec-4bb9-b100-4e3e586ec84f</v12:csId>
</v1:domain>
</v1:setCloudAccountDomainRequest>
@jeffdeville
jeffdeville / account_service.rb
Created March 18, 2014 22:51
Would something like this work?
module UCP
class AccountService
attr_writer :cs_acct_service, :bsil_acct_service
def initialize(cs_acct_service, bsil_acct_service)
@cs_acct_service = cs_acct_service
@bsil_acct_service = bsil_acct_service
end
# This is where 'workflows' can live. If they aren't sync,
@jeffdeville
jeffdeville / updateAccountRequest.xml
Created March 12, 2014 17:15
Attempt to make updateAccount Work
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.sungard.com/bsil/acctmgmt/v1-0" xmlns:v11="http://www.sungard.com/ws/v1-0" xmlns:v12="http://www.sungard.com/common/v1-0">
<soapenv:Header/>
<soapenv:Body>
<v1:updateAccountRequest>
<v11:client>
<v11:userId>?</v11:userId>
<v11:userApplicationDN>?</v11:userApplicationDN>
</v11:client>
<v1:accountNumber>3ad1d8fc-ad84-41e4-ad43-4dc9b673ca49</v1:accountNumber>
<v1:version>1854</v1:version>