#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH << File.expand_path('../../lib', __FILE__) require 'super_identity' # Sample client using this gem class IdentityEnhancement include SuperIdentity::Client attr_reader :ide_config def initialize(opts) @ide_config = opts end def run(shared_token) puts "Enhancements for shared_token: #{shared_token}" puts '------------' identity_enhancements(shared_token).each do |attr| puts "name: #{attr[:name]}" puts "value: #{attr[:value]}" puts '------------' end end end host, shared_token, cert, key = ARGV if shared_token.nil? puts "usage: #{$PROGRAM_NAME} host shared_token [cert] [key]" exit 1 end cert ||= File.expand_path('~/.aaf/api-client.crt') key ||= File.expand_path('~/.aaf/api-client.key') opts = { host: host, cert: cert, key: key } IdentityEnhancement.new(opts).run(shared_token)