Skip to content

Commit

Permalink
Add domain verification intent in admin portal link generation (#351)
Browse files Browse the repository at this point in the history
* Add domain verification intent in admin portal link generation

* refactor: update order lexicographically

* fix: syntax issue

* fix: remove trailing whitespace
  • Loading branch information
sahilbansal17 authored Feb 10, 2025
1 parent faba97f commit f947050
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/workos/types/intent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ module Types
module Intent
AUDIT_LOGS = 'audit_logs'
CERTIFICATE_RENEWAL = 'certificate_renewal'
DOMAIN_VERIFICATION = 'domain_verification'
DSYNC = 'dsync'
LOG_STREAMS = 'log_streams'
SSO = 'sso'

ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DSYNC, LOG_STREAMS, SSO].freeze
ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DOMAIN_VERIFICATION, DSYNC, LOG_STREAMS, SSO].freeze
end
end
end
15 changes: 15 additions & 0 deletions spec/lib/workos/portal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@
end
end

describe 'with the domain_verification intent' do
it 'returns an Admin Portal link' do
VCR.use_cassette 'portal/generate_link_domain_verification', match_requests_on: %i[path body] do
portal_link = described_class.generate_link(
intent: 'domain_verification',
organization: organization,
)

expect(portal_link).to eq(
'https://id.workos.com/portal/launch?secret=secret',
)
end
end
end

describe 'with an invalid organization' do
it 'raises an error' do
VCR.use_cassette 'portal/generate_link_invalid' do
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f947050

Please sign in to comment.