From c9f3375a18221cd487d9f60fba38a53d943a4364 Mon Sep 17 00:00:00 2001 From: Michael Bleigh Date: Mon, 29 Nov 2010 12:59:20 -0600 Subject: [PATCH] Everything can now be initialized with a block instead of arguments. Closes #56 --- oa-basic/lib/omniauth/strategies/http_basic.rb | 2 +- oa-core/lib/omniauth/strategies/password.rb | 4 ++-- oa-core/lib/omniauth/strategy.rb | 4 +++- oa-enterprise/README.rdoc | 2 +- oa-enterprise/lib/omniauth/strategies/cas.rb | 4 ++-- oa-enterprise/lib/omniauth/strategies/ldap.rb | 5 ++--- oa-oauth/README.rdoc | 2 +- oa-oauth/lib/omniauth/strategies/dopplr.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/facebook.rb | 10 +++++----- oa-oauth/lib/omniauth/strategies/foursquare.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/github.rb | 8 ++++---- oa-oauth/lib/omniauth/strategies/gowalla.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/identica.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/linked_in.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/meetup.rb | 2 +- oa-oauth/lib/omniauth/strategies/oauth.rb | 4 +++- oa-oauth/lib/omniauth/strategies/oauth2.rb | 12 +++++++++--- oa-oauth/lib/omniauth/strategies/smug_mug.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/sound_cloud.rb | 2 +- .../lib/omniauth/strategies/thirty_seven_signals.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/trip_it.rb | 4 ++-- oa-oauth/lib/omniauth/strategies/twitter.rb | 2 +- oa-oauth/spec/support/shared_examples.rb | 8 ++++++++ oa-openid/lib/omniauth/strategies/google_apps.rb | 4 ++-- oa-openid/lib/omniauth/strategies/open_id.rb | 4 ++-- 25 files changed, 64 insertions(+), 47 deletions(-) diff --git a/oa-basic/lib/omniauth/strategies/http_basic.rb b/oa-basic/lib/omniauth/strategies/http_basic.rb index 61dd32b..6e7d3c4 100644 --- a/oa-basic/lib/omniauth/strategies/http_basic.rb +++ b/oa-basic/lib/omniauth/strategies/http_basic.rb @@ -6,7 +6,7 @@ module OmniAuth class HttpBasic include OmniAuth::Strategy - def initialize(app, name, endpoint, headers = {}) + def initialize(app, name, endpoint = nil, headers = {}, &block) super @endpoint = endpoint @request_headers = headers diff --git a/oa-core/lib/omniauth/strategies/password.rb b/oa-core/lib/omniauth/strategies/password.rb index 01ab9c1..b09397d 100644 --- a/oa-core/lib/omniauth/strategies/password.rb +++ b/oa-core/lib/omniauth/strategies/password.rb @@ -6,10 +6,10 @@ module OmniAuth class Password include OmniAuth::Strategy - def initialize(app, secret = 'changethisappsecret', options = {}) + def initialize(app, secret = 'changethisappsecret', options = {}, &block) @options = options @secret = secret - super(app, :password) + super(app, :password, &block) end attr_reader :secret diff --git a/oa-core/lib/omniauth/strategy.rb b/oa-core/lib/omniauth/strategy.rb index 10b36fd..e096dfc 100644 --- a/oa-core/lib/omniauth/strategy.rb +++ b/oa-core/lib/omniauth/strategy.rb @@ -11,10 +11,12 @@ module OmniAuth end end - def initialize(app, name, *args) + def initialize(app, name, *args, &block) @app = app @name = name.to_sym @options = args.last.is_a?(Hash) ? args.pop : {} + + yield self if block_given? end def call(env) diff --git a/oa-enterprise/README.rdoc b/oa-enterprise/README.rdoc index 335bcb6..aaaabb2 100644 --- a/oa-enterprise/README.rdoc +++ b/oa-enterprise/README.rdoc @@ -29,7 +29,7 @@ Use the LDAP strategy as a middleware in your applicaiton: require 'omniauth/enterprise' use OmniAuth::Strategies::LDAP, - "My LDAP", + :title => "My LDAP", :host => '10.101.10.1', :port => 389, :method => :plain, diff --git a/oa-enterprise/lib/omniauth/strategies/cas.rb b/oa-enterprise/lib/omniauth/strategies/cas.rb index 10433eb..8f6ce09 100644 --- a/oa-enterprise/lib/omniauth/strategies/cas.rb +++ b/oa-enterprise/lib/omniauth/strategies/cas.rb @@ -8,8 +8,8 @@ module OmniAuth autoload :Configuration, 'omniauth/strategies/cas/configuration' autoload :ServiceTicketValidator, 'omniauth/strategies/cas/service_ticket_validator' - def initialize(app, options = {}) - super(app, options.delete(:name) || :cas, options) + def initialize(app, options = {}, &block) + super(app, options.delete(:name) || :cas, options, &block) @configuration = OmniAuth::Strategies::CAS::Configuration.new(options) end diff --git a/oa-enterprise/lib/omniauth/strategies/ldap.rb b/oa-enterprise/lib/omniauth/strategies/ldap.rb index a277153..f8ac42d 100644 --- a/oa-enterprise/lib/omniauth/strategies/ldap.rb +++ b/oa-enterprise/lib/omniauth/strategies/ldap.rb @@ -27,9 +27,8 @@ module OmniAuth # # @param [Rack Application] app Standard Rack middleware argument. # @option options [String, 'LDAP Authentication'] :title A title for the authentication form. - def initialize(app, title, options = {}) - super(app, options[:name] || :ldap, options.dup) - @title = title + def initialize(app, options = {}, &block) + super(app, options[:name] || :ldap, options.dup, &block) @name_proc = (@options.delete(:name_proc) || Proc.new {|name| name}) @adaptor = OmniAuth::Strategies::LDAP::Adaptor.new(options) end diff --git a/oa-oauth/README.rdoc b/oa-oauth/README.rdoc index 8ee6572..e3ce68a 100644 --- a/oa-oauth/README.rdoc +++ b/oa-oauth/README.rdoc @@ -30,6 +30,6 @@ If you want to allow multiple providers, use the OmniAuth Builder: use OmniAuth::Builder do provider :twitter, 'consumer_key', 'consumer_secret' - provider :facebook, 'app_id', 'app_secret' + provider :facebook, 'client_id', 'client_secret' end \ No newline at end of file diff --git a/oa-oauth/lib/omniauth/strategies/dopplr.rb b/oa-oauth/lib/omniauth/strategies/dopplr.rb index 322caa6..8574c1e 100644 --- a/oa-oauth/lib/omniauth/strategies/dopplr.rb +++ b/oa-oauth/lib/omniauth/strategies/dopplr.rb @@ -13,7 +13,7 @@ module OmniAuth # Initialize the Dopplr strategy. # # @option options [Hash, {}] :client_options Options to be passed directly to the OAuth Consumer - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) client_options = { :site => 'https://www.dopplr.com', :request_token_path => "/oauth/request_token", @@ -21,7 +21,7 @@ module OmniAuth :authorize_path => "/oauth/authorize" } - super(app, :dopplr, consumer_key, consumer_secret, client_options, options) + super(app, :dopplr, consumer_key, consumer_secret, client_options, options, &block) end def user_data diff --git a/oa-oauth/lib/omniauth/strategies/facebook.rb b/oa-oauth/lib/omniauth/strategies/facebook.rb index 78eb2ef..6133f4f 100644 --- a/oa-oauth/lib/omniauth/strategies/facebook.rb +++ b/oa-oauth/lib/omniauth/strategies/facebook.rb @@ -7,14 +7,14 @@ module OmniAuth # basic user information. # # @example Basic Usage - # use OmniAuth::Strategies::Facebook, 'app_id', 'app_secret' + # use OmniAuth::Strategies::Facebook, 'client_id', 'client_secret' class Facebook < OAuth2 # @param [Rack Application] app standard middleware application parameter - # @param [String] app_id the application id as [registered on Facebook](http://www.facebook.com/developers/) - # @param [String] app_secret the application secret as registered on Facebook + # @param [String] client_id the application id as [registered on Facebook](http://www.facebook.com/developers/) + # @param [String] client_secret the application secret as registered on Facebook # @option options [String] :scope ('email,offline_access') comma-separated extended permissions such as `email` and `manage_pages` - def initialize(app, app_id, app_secret, options = {}) - super(app, :facebook, app_id, app_secret, {:site => 'https://graph.facebook.com/'}, options) + def initialize(app, client_id = nil, client_secret = nil, options = {}, &block) + super(app, :facebook, client_id, client_secret, {:site => 'https://graph.facebook.com/'}, options, &block) end def user_data diff --git a/oa-oauth/lib/omniauth/strategies/foursquare.rb b/oa-oauth/lib/omniauth/strategies/foursquare.rb index 40af400..dd41fb2 100644 --- a/oa-oauth/lib/omniauth/strategies/foursquare.rb +++ b/oa-oauth/lib/omniauth/strategies/foursquare.rb @@ -8,7 +8,7 @@ module OmniAuth # # @option options [Boolean, true] :sign_in When true, use a sign-in flow instead of the authorization flow. # @option options [Boolean, false] :mobile When true, use the mobile sign-in interface. - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) client_options = {:site => 'http://foursquare.com'} auth_path = (options[:sign_in] == false) ? '/oauth/authorize' : '/oauth/authenticate' @@ -16,7 +16,7 @@ module OmniAuth client_options[:authorize_path] = auth_path - super(app, :foursquare, consumer_key, consumer_secret, client_options, options) + super(app, :foursquare, consumer_key, consumer_secret, client_options, options, &block) end def auth_hash diff --git a/oa-oauth/lib/omniauth/strategies/github.rb b/oa-oauth/lib/omniauth/strategies/github.rb index 533a822..1dce13c 100644 --- a/oa-oauth/lib/omniauth/strategies/github.rb +++ b/oa-oauth/lib/omniauth/strategies/github.rb @@ -8,16 +8,16 @@ module OmniAuth # and provide the proper credentials to this middleware. class GitHub < OAuth2 # @param [Rack Application] app standard middleware application argument - # @param [String] app_id the application ID for your client - # @param [String] app_secret the application secret - def initialize(app, app_id, app_secret, options = {}) + # @param [String] client_id the application ID for your client + # @param [String] client_secret the application secret + def initialize(app, client_id = nil, client_secret = nil, options = {}, &block) client_options = { :site => 'https://github.com/', :authorize_path => '/login/oauth/authorize', :access_token_path => '/login/oauth/access_token' } - super(app, :github, app_id, app_secret, client_options, options) + super(app, :github, client_id, client_secret, client_options, options, &block) end protected diff --git a/oa-oauth/lib/omniauth/strategies/gowalla.rb b/oa-oauth/lib/omniauth/strategies/gowalla.rb index 1c6a1b4..69c9f56 100644 --- a/oa-oauth/lib/omniauth/strategies/gowalla.rb +++ b/oa-oauth/lib/omniauth/strategies/gowalla.rb @@ -14,14 +14,14 @@ module OmniAuth # @param [String] api_key the application id as [registered on Gowalla](http://gowalla.com/api/keys) # @param [String] secret_key the application secret as [registered on Gowalla](http://gowalla.com/api/keys) # @option options ['read','read-write'] :scope ('read') the scope of your authorization request; must be `read` or `read-write` - def initialize(app, api_key, secret_key, options = {}) + def initialize(app, api_key = nil, secret_key = nil, options = {}, &block) client_options = { :site => 'https://api.gowalla.com/api/oauth', :authorize_url => 'https://gowalla.com/api/oauth/new', :access_token_url => 'https://api.gowalla.com/api/oauth/token' } - super(app, :gowalla, api_key, secret_key, client_options, options) + super(app, :gowalla, api_key, secret_key, client_options, options, &block) end protected diff --git a/oa-oauth/lib/omniauth/strategies/identica.rb b/oa-oauth/lib/omniauth/strategies/identica.rb index 56bc54f..82c8397 100644 --- a/oa-oauth/lib/omniauth/strategies/identica.rb +++ b/oa-oauth/lib/omniauth/strategies/identica.rb @@ -12,12 +12,12 @@ module OmniAuth # use OmniAuth::Strategies::Identica, 'consumerkey', 'consumersecret' # class Identica < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :identica, consumer_key, consumer_secret, {:site => 'http://identi.ca', :request_token_path => "/api/oauth/request_token", :access_token_path => "/api/oauth/access_token", - :authorize_path => "/api/oauth/authorize"}, options) + :authorize_path => "/api/oauth/authorize"}, options, &block) end def auth_hash diff --git a/oa-oauth/lib/omniauth/strategies/linked_in.rb b/oa-oauth/lib/omniauth/strategies/linked_in.rb index 1b0fdb5..1f36fc4 100644 --- a/oa-oauth/lib/omniauth/strategies/linked_in.rb +++ b/oa-oauth/lib/omniauth/strategies/linked_in.rb @@ -4,13 +4,13 @@ require 'omniauth/oauth' module OmniAuth module Strategies class LinkedIn < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :linked_in, consumer_key, consumer_secret, {:site => 'https://api.linkedin.com', :request_token_path => '/uas/oauth/requestToken', :access_token_path => '/uas/oauth/accessToken', :authorize_path => '/uas/oauth/authorize', - :scheme => :header}, options) + :scheme => :header}, options, &block) end def auth_hash diff --git a/oa-oauth/lib/omniauth/strategies/meetup.rb b/oa-oauth/lib/omniauth/strategies/meetup.rb index accc57f..8877e54 100644 --- a/oa-oauth/lib/omniauth/strategies/meetup.rb +++ b/oa-oauth/lib/omniauth/strategies/meetup.rb @@ -11,7 +11,7 @@ module OmniAuth # use OmniAuth::Strategies::Meetup, 'consumerkey', 'consumersecret' # class Meetup < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :meetup, consumer_key, consumer_secret, # :site => 'https://api.meetup.com', {:request_token_path => "https://api.meetup.com/oauth/request", diff --git a/oa-oauth/lib/omniauth/strategies/oauth.rb b/oa-oauth/lib/omniauth/strategies/oauth.rb index d610b85..b2a102d 100644 --- a/oa-oauth/lib/omniauth/strategies/oauth.rb +++ b/oa-oauth/lib/omniauth/strategies/oauth.rb @@ -6,7 +6,9 @@ module OmniAuth class OAuth include OmniAuth::Strategy - def initialize(app, name, consumer_key, consumer_secret, consumer_options = {}, options = {}) + def initialize(app, name, consumer_key = nil, consumer_secret = nil, consumer_options = {}, options = {}, &block) + self.consumer_key = consumer_key + self.consumer_secret = consumer_secret self.consumer_options = consumer_options super end diff --git a/oa-oauth/lib/omniauth/strategies/oauth2.rb b/oa-oauth/lib/omniauth/strategies/oauth2.rb index 412cceb..2262d85 100644 --- a/oa-oauth/lib/omniauth/strategies/oauth2.rb +++ b/oa-oauth/lib/omniauth/strategies/oauth2.rb @@ -16,7 +16,7 @@ module OmniAuth # The options passed in to the strategy. attr_accessor :options # The `OAuth2::Client` for this strategy. - attr_accessor :client + attr_accessor :client_id, :client_secret, :client_options # An error that is indicated in the OAuth 2.0 callback. # This could be a `redirect_uri_mismatch` or other @@ -37,9 +37,15 @@ module OmniAuth # @param [String] client_id the client/application ID of this provider # @param [String] client_secret the client/application secret of this provider # @param [Hash] options that will be passed through to the OAuth2::Client (see [oauth2 docs](http://rubydoc.info/gems/oauth2)) - def initialize(app, name, client_id, client_secret, client_options = {}, options = {}) + def initialize(app, name, client_id = nil, client_secret = nil, client_options = {}, options = {}, &block) + self.client_id = client_id + self.client_secret = client_secret + self.client_options = client_options super - self.client = ::OAuth2::Client.new(client_id, client_secret, client_options.merge(options[:client_options] || {})) + end + + def client + ::OAuth2::Client.new(client_id, client_secret, client_options.merge(options[:client_options] || {})) end protected diff --git a/oa-oauth/lib/omniauth/strategies/smug_mug.rb b/oa-oauth/lib/omniauth/strategies/smug_mug.rb index d7d695b..fc2cb2e 100644 --- a/oa-oauth/lib/omniauth/strategies/smug_mug.rb +++ b/oa-oauth/lib/omniauth/strategies/smug_mug.rb @@ -9,12 +9,12 @@ module OmniAuth # use OmniAuth::Strategies::SmugMug, 'consumerkey', 'consumersecret' # class SmugMug < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :smugmug, consumer_key, consumer_secret, {:site => 'http://api.smugmug.com', :request_token_path => "/services/oauth/getRequestToken.mg", :access_token_path => "/services/oauth/getAccessToken.mg", - :authorize_path => "/services/oauth/authorize.mg"}, options) + :authorize_path => "/services/oauth/authorize.mg"}, options, &block) end def auth_hash diff --git a/oa-oauth/lib/omniauth/strategies/sound_cloud.rb b/oa-oauth/lib/omniauth/strategies/sound_cloud.rb index a0b4142..33c93c5 100644 --- a/oa-oauth/lib/omniauth/strategies/sound_cloud.rb +++ b/oa-oauth/lib/omniauth/strategies/sound_cloud.rb @@ -13,7 +13,7 @@ module OmniAuth # class SoundCloud < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :soundcloud, consumer_key, consumer_secret, {:site => 'https://api.soundcloud.com'}, options) end diff --git a/oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb b/oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb index ec5683a..818ee8b 100644 --- a/oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb +++ b/oa-oauth/lib/omniauth/strategies/thirty_seven_signals.rb @@ -4,14 +4,14 @@ require 'multi_json' module OmniAuth module Strategies class ThirtySevenSignals < OAuth2 - def initialize(app, app_id, app_secret, options = {}) + def initialize(app, client_id = nil, client_secret = nil, options = {}, &block) client_options = { :site => 'https://launchpad.37signals.com/', :authorize_path => '/authorization/new', :access_token_path => '/authorization/token' } - super(app, :thirty_seven_signals, app_id, app_secret, client_options, options) + super(app, :thirty_seven_signals, client_id, client_secret, client_options, options, &block) end def user_data diff --git a/oa-oauth/lib/omniauth/strategies/trip_it.rb b/oa-oauth/lib/omniauth/strategies/trip_it.rb index 07fba24..0f93abb 100644 --- a/oa-oauth/lib/omniauth/strategies/trip_it.rb +++ b/oa-oauth/lib/omniauth/strategies/trip_it.rb @@ -10,12 +10,12 @@ module OmniAuth # use OmniAuth::Strategies::TripIt, 'consumerkey', 'consumersecret' # class TripIt < OmniAuth::Strategies::OAuth - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) super(app, :tripit, consumer_key, consumer_secret, {:site => 'https://api.tripit.com', :request_token_path => "/oauth/request_token", :access_token_path => "/oauth/access_token", - :authorize_url => "https://www.tripit.com/oauth/authorize"}, options) + :authorize_url => "https://www.tripit.com/oauth/authorize"}, options, &block) end def request_phase diff --git a/oa-oauth/lib/omniauth/strategies/twitter.rb b/oa-oauth/lib/omniauth/strategies/twitter.rb index 42b2a98..d2f581b 100644 --- a/oa-oauth/lib/omniauth/strategies/twitter.rb +++ b/oa-oauth/lib/omniauth/strategies/twitter.rb @@ -15,7 +15,7 @@ module OmniAuth # Initialize the middleware # # @option options [Boolean, true] :sign_in When true, use the "Sign in with Twitter" flow instead of the authorization flow. - def initialize(app, consumer_key, consumer_secret, options = {}) + def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) client_options = { :site => 'https://api.twitter.com' } diff --git a/oa-oauth/spec/support/shared_examples.rb b/oa-oauth/spec/support/shared_examples.rb index 2851d4a..526b098 100644 --- a/oa-oauth/spec/support/shared_examples.rb +++ b/oa-oauth/spec/support/shared_examples.rb @@ -2,6 +2,10 @@ shared_examples_for "an oauth strategy" do it 'should be initializable with only three arguments' do lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error end + + it 'should be initializable with a block' do + lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.consumer_key = 'abc'} }.should_not raise_error + end it 'should handle the setting of client options' do s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'}) @@ -13,6 +17,10 @@ shared_examples_for "an oauth2 strategy" do it 'should be initializable with only three arguments' do lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret') }.should_not raise_error end + + it 'should be initializable with a block' do + lambda{ strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}){|s| s.client_id = 'abc'} }.should_not raise_error + end it 'should handle the setting of client options' do s = strategy_class.new(lambda{|env| [200, {}, ['Hello World']]}, 'key', 'secret', :client_options => {:abc => 'def'}) diff --git a/oa-openid/lib/omniauth/strategies/google_apps.rb b/oa-openid/lib/omniauth/strategies/google_apps.rb index 84e16a1..1ccf159 100644 --- a/oa-openid/lib/omniauth/strategies/google_apps.rb +++ b/oa-openid/lib/omniauth/strategies/google_apps.rb @@ -3,9 +3,9 @@ require 'omniauth/openid' module OmniAuth module Strategies class GoogleApps < OmniAuth::Strategies::OpenID - def initialize(app, store = nil, options = {}) + def initialize(app, store = nil, options = {}, &block) options[:name] ||= 'google_apps' - super(app, store, options) + super(app, store, options, &block) end def get_identifier diff --git a/oa-openid/lib/omniauth/strategies/open_id.rb b/oa-openid/lib/omniauth/strategies/open_id.rb index 01af8cb..f05ca77 100644 --- a/oa-openid/lib/omniauth/strategies/open_id.rb +++ b/oa-openid/lib/omniauth/strategies/open_id.rb @@ -35,8 +35,8 @@ module OmniAuth # @option options [Array] :optional The optional attributes for the OpenID request. May # be ActiveExchange or sreg. # @option options [Symbol, :open_id] :name The URL segment name for this provider. - def initialize(app, store = nil, options = {}) - super(app, options[:name] || :open_id) + def initialize(app, store = nil, options = {}, &block) + super(app, (options[:name] || :open_id), &block) @options = options @options[:required] ||= [AX[:email], AX[:name], AX[:first_name], AX[:last_name], 'email', 'fullname'] @options[:optional] ||= [AX[:nickname], AX[:city], AX[:state], AX[:website], AX[:image], 'postcode', 'nickname']