Skip to content

Commit f947050

Browse files
Add domain verification intent in admin portal link generation (#351)
* Add domain verification intent in admin portal link generation * refactor: update order lexicographically * fix: syntax issue * fix: remove trailing whitespace
1 parent faba97f commit f947050

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

lib/workos/types/intent.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ module Types
77
module Intent
88
AUDIT_LOGS = 'audit_logs'
99
CERTIFICATE_RENEWAL = 'certificate_renewal'
10+
DOMAIN_VERIFICATION = 'domain_verification'
1011
DSYNC = 'dsync'
1112
LOG_STREAMS = 'log_streams'
1213
SSO = 'sso'
1314

14-
ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DSYNC, LOG_STREAMS, SSO].freeze
15+
ALL = [AUDIT_LOGS, CERTIFICATE_RENEWAL, DOMAIN_VERIFICATION, DSYNC, LOG_STREAMS, SSO].freeze
1516
end
1617
end
1718
end

spec/lib/workos/portal_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@
6868
end
6969
end
7070

71+
describe 'with the domain_verification intent' do
72+
it 'returns an Admin Portal link' do
73+
VCR.use_cassette 'portal/generate_link_domain_verification', match_requests_on: %i[path body] do
74+
portal_link = described_class.generate_link(
75+
intent: 'domain_verification',
76+
organization: organization,
77+
)
78+
79+
expect(portal_link).to eq(
80+
'https://id.workos.com/portal/launch?secret=secret',
81+
)
82+
end
83+
end
84+
end
85+
7186
describe 'with an invalid organization' do
7287
it 'raises an error' do
7388
VCR.use_cassette 'portal/generate_link_invalid' do

spec/support/fixtures/vcr_cassettes/portal/generate_link_domain_verification.yml

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)