Skip to content

added impersonate method#103

Merged
bartes merged 6 commits intomasterfrom
impersonate
Jan 27, 2018
Merged

added impersonate method#103
bartes merged 6 commits intomasterfrom
impersonate

Conversation

@bartes
Copy link
Copy Markdown
Contributor

@bartes bartes commented Jan 26, 2018

No description provided.

@bartes bartes self-assigned this Jan 26, 2018
@bartes bartes added the wip label Jan 26, 2018
@bartes bartes force-pushed the impersonate branch 2 times, most recently from 4c3e430 to f215f26 Compare January 26, 2018 14:41
def impersonate(options = {})
options = Castle::Utils.deep_symbolize_keys(options || {})

return unless tracked?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this. Doesn't apply to impersonate

private

def validate!(options)
%i[user_id].each do |key|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From impersonate endpoint:

requires :user_id, type: String
requires :user_agent, type: String
requires :ip, type: String
optional :impersonator, type: String
optional :client_id, type: String

Please update validation

Copy link
Copy Markdown
Contributor Author

@bartes bartes Jan 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lluft - I'm changing the endpoint . It will look like this before merging this:

        requires :user_id, type: String
        optional :impersonator, type: String, desc: 'Impersonator email'
        optional :context, type: Hash, desc: 'Request context. (includes Ip, User-Agent, ClientId)'
        optional :timestamp, desc: 'Timestamp of the event', types: [String, Time]
        optional :sent_at, type: String
        optional :received_at, type: String

@bartes
Copy link
Copy Markdown
Contributor Author

bartes commented Jan 26, 2018

@lluft - added validation for required fields, remove timestamp from that endpoint, now it should be fine


before do
Timecop.freeze(time_now)
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before { Timecop.freeze(time_now) }


after do
Timecop.return
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after { Timecop.return }

@bartes
Copy link
Copy Markdown
Contributor Author

bartes commented Jan 27, 2018

@nijikon - this is done

@bartes bartes merged commit 32c0af0 into master Jan 27, 2018
@bartes bartes deleted the impersonate branch January 27, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants