yandex360 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +110 -1
- data/README.md +112 -121
- data/README.ru.md +109 -119
- data/lib/yandex360/client.rb +8 -1
- data/lib/yandex360/objects/types.rb +42 -0
- data/lib/yandex360/resources/departments.rb +5 -2
- data/lib/yandex360/resources/dns.rb +6 -3
- data/lib/yandex360/resources/domains.rb +42 -10
- data/lib/yandex360/resources/groups.rb +7 -0
- data/lib/yandex360/resources/mail_settings.rb +72 -0
- data/lib/yandex360/resources/organizations.rb +14 -4
- data/lib/yandex360/resources/two_fa.rb +35 -15
- data/lib/yandex360/resources/users.rb +2 -1
- data/lib/yandex360/version.rb +1 -1
- metadata +2 -2
- data/lib/yandex360/resources/post_settings.rb +0 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c0a4afac73e5265e480369e774ae31ef8e2e1e647b7443fb73c9eb54a961835
|
|
4
|
+
data.tar.gz: 0f931993c435fc14e439f838122db029e80e2804ac442e5e1b19f3610581f341
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90967ccab57a20f2aa22f4e1e5fcad39f073a024b44c61ba509dfdba8d04dbd1b065fb62291e4f6796d58172a988a2de6b88abe2fe9e36ffb0333a11be2b4740
|
|
7
|
+
data.tar.gz: 9f86f9c0edfae65a807cdf08c11a58c5bb3bb71200ce705a7a9f76ee050b1d5244f0df38334ab10700a6146dd51b3ef7fe8fa87358788d5f037f034b5105cc6c
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,114 @@ follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [4.0.0] - 2026-09-21
|
|
10
|
+
|
|
11
|
+
Every path in the gem has now been read against the published reference
|
|
12
|
+
individually. Five areas were wrong, and the four services that follow were
|
|
13
|
+
calling endpoints that do not exist.
|
|
14
|
+
|
|
15
|
+
### Breaking
|
|
16
|
+
|
|
17
|
+
- `two_fa` covers the organization only, and its methods have changed. Three of
|
|
18
|
+
the five called paths that are not in the API:
|
|
19
|
+
`/security/v1/org/{orgId}/users/{userId}/2fa/enable`, `/disable` and
|
|
20
|
+
`/status` do not exist. A fourth, `configure_domain`, used the right path but
|
|
21
|
+
sent `enabled`, which the endpoint does not accept.
|
|
22
|
+
|
|
23
|
+
`Domain2FAService` puts all three operations on one path and distinguishes
|
|
24
|
+
them by verb:
|
|
25
|
+
|
|
26
|
+
| Operation | Method |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `two_fa.status(org_id:)` | `GET /security/v1/org/{orgId}/domain_2fa` |
|
|
29
|
+
| `two_fa.enable(org_id:, duration:, ...)` | `POST` to the same path |
|
|
30
|
+
| `two_fa.disable(org_id:)` | `DELETE` to the same path |
|
|
31
|
+
|
|
32
|
+
`duration` is required, since the API does not default it, and
|
|
33
|
+
`logout_users` and `validation_method` are optional. `domain_status` remains
|
|
34
|
+
as an alias of `status` that warns, removed in 5.0. `configure_domain` is
|
|
35
|
+
gone: with enabling and disabling now separate verbs there is nothing for it
|
|
36
|
+
to mean.
|
|
37
|
+
|
|
38
|
+
Per-employee 2FA was never here. Reading it is `users.get2FA` and clearing
|
|
39
|
+
the phone is `users.delete_2fa_phone`, both of which were already correct.
|
|
40
|
+
|
|
41
|
+
- `client.post_settings` is now `client.mail_settings`, and every method on it
|
|
42
|
+
has changed. The old resource called paths that are not part of the API:
|
|
43
|
+
`/directory/v1/org/{orgId}/users/{userId}/settings/mail` and its forwarding
|
|
44
|
+
sub-paths do not exist, so none of it could have worked. The real service is
|
|
45
|
+
`MailUserSettingsService`, under
|
|
46
|
+
`/admin/v1/org/{orgId}/mail/users/{userId}/settings`, and it covers three
|
|
47
|
+
settings rather than one:
|
|
48
|
+
|
|
49
|
+
| Setting | Path | Methods |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| Contact collection | `address_book` | `address_book`, `update_address_book` |
|
|
52
|
+
| Sender name and signatures | `sender_info` | `sender_info`, `update_sender_info` |
|
|
53
|
+
| Auto-replies and forwards | `user_rules` | `rules`, `create_rule`, `delete_rule` |
|
|
54
|
+
|
|
55
|
+
Forwarding is one of two kinds of rule rather than a thing of its own, so
|
|
56
|
+
`forwarding_list`, `add_forwarding` and `delete_forwarding` have no
|
|
57
|
+
successors of the same shape. `client.post_settings` stays as an accessor
|
|
58
|
+
that warns and returns the new resource, removed in 5.0.
|
|
59
|
+
|
|
60
|
+
- `domains.verify` and `domains.info` are gone. `DomainService` has seven
|
|
61
|
+
operations and neither is among them: there is no way to verify a domain
|
|
62
|
+
through a dedicated call, and no way to read one domain. What verification
|
|
63
|
+
actually needs is `domains.connection_status`, which answers the confirmation
|
|
64
|
+
methods and their codes. `domains.find` replaces `info` by walking the list,
|
|
65
|
+
and is named for what it does, since it costs a request per page.
|
|
66
|
+
- `organizations.info` now searches the list rather than fetching.
|
|
67
|
+
`OrganizationsService` offers only a list, so the path it used,
|
|
68
|
+
`/directory/v1/org/{orgId}`, does not exist. The method keeps its name and
|
|
69
|
+
its arguments and returns nil when the token does not reach that
|
|
70
|
+
organization.
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
|
|
74
|
+
- The four domain operations the gem never had: `connection_status`,
|
|
75
|
+
`dkim_status`, `enable_dkim` and `disable_dkim`.
|
|
76
|
+
|
|
77
|
+
- Pagination on the three lists that have it and were missing it: `domains` and
|
|
78
|
+
`dns` take `page` and `per_page`, and `organizations` pages by token, so it
|
|
79
|
+
takes `page_size` and no `page`. Which list paginates and how was read from
|
|
80
|
+
the reference one endpoint at a time rather than assumed, and the lists that
|
|
81
|
+
answer everything at once, group members, mailbox access rights and service
|
|
82
|
+
applications, are left without arguments the API would ignore. Both READMEs
|
|
83
|
+
now say which is which.
|
|
84
|
+
- `groups.members`, answering the departments, groups and employees a group
|
|
85
|
+
holds. `ListMembers` returns all three and `groups.users` shows one, so
|
|
86
|
+
members of the other two kinds were invisible.
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
|
|
90
|
+
- `users.add_alias` returns a `User` again. `CreateUserAlias` answers the whole
|
|
91
|
+
employee, aliases included, not the alias. It was changed to `Alias` in 3.0.0
|
|
92
|
+
on the strength of a stub that had invented that shape, which is exactly the
|
|
93
|
+
mistake the typed records were meant to expose rather than commit.
|
|
94
|
+
- `departments.add_alias` returns a `Department` for the same reason, and
|
|
95
|
+
`departments.delete_alias` a `DepartmentAlias`, since deleting one does
|
|
96
|
+
answer `{alias, removed}`.
|
|
97
|
+
- The stub for `groups.delete_user` said `removed`; `DeleteMember` answers
|
|
98
|
+
`deleted`. `GroupService_Delete` does answer `removed`, so the two really do
|
|
99
|
+
differ and the spec now asserts each correctly.
|
|
100
|
+
|
|
101
|
+
### Internal
|
|
102
|
+
|
|
103
|
+
- The Trivy scan is removed. It duplicated `bundle audit`: across 86 runs it
|
|
104
|
+
reported the same five advisories in faraday and json, and dropped to zero
|
|
105
|
+
the day the lockfile was refreshed. It never found anything `bundle audit`
|
|
106
|
+
did not, there is no Dockerfile or infrastructure here for it to scan, and
|
|
107
|
+
its findings went to the Security tab where they sat unread for months while
|
|
108
|
+
the failing `bundle audit` step is what actually forced the fix. It was also
|
|
109
|
+
the job that broke, failing to download its own binary. CodeQL remains the
|
|
110
|
+
primary analysis, alongside bundle audit, dependency review and Dependabot.
|
|
111
|
+
|
|
112
|
+
### Notes
|
|
113
|
+
|
|
114
|
+
Every path and response shape in the gem has now been checked against the
|
|
115
|
+
published reference rather than against our own stubs.
|
|
116
|
+
|
|
9
117
|
## [3.2.0] - 2026-09-21
|
|
10
118
|
|
|
11
119
|
### Added
|
|
@@ -331,7 +439,8 @@ and is kept below unchanged. Release notes for those versions are also on the
|
|
|
331
439
|
- build(deps): bump ruby/setup-ruby from 1.316.0 to 1.319.0 by @dependabot[bot] in #149
|
|
332
440
|
- build(deps): bump github/codeql-action from 4 to 4.37.4 by @dependabot[bot] in #152
|
|
333
441
|
|
|
334
|
-
[Unreleased]: https://github.com/ruby-api-client/yandex360/compare/
|
|
442
|
+
[Unreleased]: https://github.com/ruby-api-client/yandex360/compare/v4.0.0...HEAD
|
|
443
|
+
[4.0.0]: https://github.com/ruby-api-client/yandex360/compare/v3.2.0...v4.0.0
|
|
335
444
|
[3.2.0]: https://github.com/ruby-api-client/yandex360/compare/v3.1.0...v3.2.0
|
|
336
445
|
[3.1.0]: https://github.com/ruby-api-client/yandex360/compare/v3.0.0...v3.1.0
|
|
337
446
|
[3.0.0]: https://github.com/ruby-api-client/yandex360/compare/v2.0.0...v3.0.0
|
data/README.md
CHANGED
|
@@ -27,7 +27,7 @@ A comprehensive Ruby wrapper for the [Yandex 360 API](https://yandex.ru/dev/api3
|
|
|
27
27
|
- [Resources](#resources)
|
|
28
28
|
- **Directory**: [Organizations](#organizations), [Users](#users), [Departments](#departments), [Groups](#groups), [External Contacts](#external-contacts)
|
|
29
29
|
- **Domains**: [Domains](#domains), [DNS Records](#dns-records)
|
|
30
|
-
- **Mail**: [
|
|
30
|
+
- **Mail**: [Mail Settings](#mail-settings), [Mailboxes](#mailboxes), [Mail Routing](#mail-routing), [Domain Policies](#domain-policies), [Antispam](#antispam)
|
|
31
31
|
- **Security**: [Two-Factor Authentication (2FA)](#two-factor-authentication-2fa), [User Sessions](#user-sessions), [Password Policy](#password-policy), [Audit Logs](#audit-logs), [Service Applications](#service-applications)
|
|
32
32
|
- [API Reference](#api-reference)
|
|
33
33
|
- [Development](#development)
|
|
@@ -58,7 +58,7 @@ A comprehensive Ruby wrapper for the [Yandex 360 API](https://yandex.ru/dev/api3
|
|
|
58
58
|
Add this line to your application's `Gemfile`:
|
|
59
59
|
|
|
60
60
|
```ruby
|
|
61
|
-
gem 'yandex360', '~>
|
|
61
|
+
gem 'yandex360', '~> 4.0'
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Then execute:
|
|
@@ -85,6 +85,11 @@ For more information, visit the [Yandex 360 API Documentation](https://yandex.ru
|
|
|
85
85
|
|
|
86
86
|
## Upgrading from 1.x
|
|
87
87
|
|
|
88
|
+
Coming from 3.x instead? The breaking changes in 4.0 are listed in the
|
|
89
|
+
[changelog](CHANGELOG.md): four resources were calling endpoints that do not
|
|
90
|
+
exist and have been corrected.
|
|
91
|
+
|
|
92
|
+
|
|
88
93
|
Two major versions happened at once: 1.1.4 was the last published release
|
|
89
94
|
before 3.0.0. Everything that needs your attention is here. The
|
|
90
95
|
[changelog](CHANGELOG.md) has the reasoning.
|
|
@@ -388,9 +393,15 @@ users.auto_paginate.each {|user| puts user.nickname }
|
|
|
388
393
|
first_fifty = client.users.list(org_id: 1234567, per_page: 25).auto_paginate.first(50)
|
|
389
394
|
```
|
|
390
395
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
`
|
|
396
|
+
Not every list paginates, and those that do differ. `users`, `groups`,
|
|
397
|
+
`departments`, `external_contacts`, `domains`, `dns` and the two mailbox
|
|
398
|
+
listings take `page` and `per_page`. `organizations` and the two audit logs
|
|
399
|
+
page by token instead, so they take `page_size` and no `page`. Group members,
|
|
400
|
+
mailbox access rights and service applications answer everything at once and
|
|
401
|
+
take neither.
|
|
402
|
+
|
|
403
|
+
Arguments given to the original call, such as `per_page` or a department's
|
|
404
|
+
`parent_id`, are carried into the following pages.
|
|
394
405
|
|
|
395
406
|
## Response Objects
|
|
396
407
|
|
|
@@ -538,7 +549,7 @@ covered.
|
|
|
538
549
|
| | `client.external_contacts` | [External Contacts](#external-contacts) |
|
|
539
550
|
| Domains | `client.domains` | [Domains](#domains) |
|
|
540
551
|
| | `client.dns` | [DNS Records](#dns-records) |
|
|
541
|
-
| Mail | `client.
|
|
552
|
+
| Mail | `client.mail_settings` | [Mail Settings](#mail-settings) |
|
|
542
553
|
| | `client.mailboxes` | [Mailboxes](#mailboxes) |
|
|
543
554
|
| | `client.routing` | [Mail Routing](#mail-routing) |
|
|
544
555
|
| | `client.domain_policies` | [Domain Policies](#domain-policies) |
|
|
@@ -571,6 +582,10 @@ puts "Email: #{org.email}"
|
|
|
571
582
|
puts "Subscription plan: #{org.subscription_plan}"
|
|
572
583
|
```
|
|
573
584
|
|
|
585
|
+
The service offers a list and nothing narrower, so this searches it rather than
|
|
586
|
+
fetching one organization. A token usually reaches a single organization, so it
|
|
587
|
+
is one request in practice.
|
|
588
|
+
|
|
574
589
|
---
|
|
575
590
|
|
|
576
591
|
### Users
|
|
@@ -900,53 +915,44 @@ client.external_contacts.delete(org_id: 1234567, contact_id: created.id)
|
|
|
900
915
|
|
|
901
916
|
### Domains
|
|
902
917
|
|
|
903
|
-
Manage organization domains and verify ownership.
|
|
904
|
-
|
|
905
|
-
#### List domains
|
|
906
|
-
|
|
907
918
|
```ruby
|
|
908
|
-
domains = client.domains.list(org_id: 1234567)
|
|
909
|
-
domains.each
|
|
910
|
-
puts "Domain: #{domain.name}"
|
|
911
|
-
puts "Status: #{domain.status}"
|
|
912
|
-
puts "Verified: #{domain.verified}"
|
|
913
|
-
end
|
|
914
|
-
```
|
|
919
|
+
domains = client.domains.list(org_id: 1234567, page: 1, per_page: 10)
|
|
920
|
+
domains.each {|domain| puts "#{domain.name} verified=#{domain.verified}" }
|
|
915
921
|
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
```ruby
|
|
919
|
-
domain = client.domains.add(
|
|
920
|
-
org_id: 1234567,
|
|
921
|
-
name: "example.com"
|
|
922
|
-
)
|
|
923
|
-
puts "Added domain: #{domain.name}"
|
|
924
|
-
puts "Verification status: #{domain.status}"
|
|
922
|
+
client.domains.add(org_id: 1234567, name: "example.com")
|
|
923
|
+
client.domains.delete(org_id: 1234567, domain: "example.com")
|
|
925
924
|
```
|
|
926
925
|
|
|
927
|
-
|
|
926
|
+
There is no endpoint for reading one domain, so `find` walks the list. It
|
|
927
|
+
costs a request per page rather than one, which is why it is named for what it
|
|
928
|
+
does:
|
|
928
929
|
|
|
929
930
|
```ruby
|
|
930
|
-
|
|
931
|
-
puts "Domain: #{domain.name}"
|
|
932
|
-
puts "Status: #{domain.status}"
|
|
933
|
-
puts "Verified: #{domain.verified}"
|
|
934
|
-
puts "Master admin email: #{domain.master_admin}"
|
|
931
|
+
client.domains.find(org_id: 1234567, domain: "example.com")
|
|
935
932
|
```
|
|
936
933
|
|
|
937
|
-
|
|
934
|
+
Connection status carries the confirmation methods and their codes, which is
|
|
935
|
+
what verifying a domain needs:
|
|
938
936
|
|
|
939
937
|
```ruby
|
|
940
|
-
|
|
941
|
-
|
|
938
|
+
status = client.domains.connection_status(org_id: 1234567, domain: "example.com")
|
|
939
|
+
status.status
|
|
940
|
+
status.methods.each {|method| puts "#{method.method}: #{method.code}" }
|
|
942
941
|
```
|
|
943
942
|
|
|
944
|
-
|
|
943
|
+
The DKIM signature:
|
|
945
944
|
|
|
946
945
|
```ruby
|
|
947
|
-
client.domains.
|
|
946
|
+
dkim = client.domains.dkim_status(org_id: 1234567, domain: "example.com")
|
|
947
|
+
dkim.enabled
|
|
948
|
+
dkim.public_key
|
|
949
|
+
|
|
950
|
+
client.domains.enable_dkim(org_id: 1234567, domain: "example.com")
|
|
951
|
+
client.domains.disable_dkim(org_id: 1234567, domain: "example.com")
|
|
948
952
|
```
|
|
949
953
|
|
|
954
|
+
Cyrillic domains must be given in Punycode, as the API documents.
|
|
955
|
+
|
|
950
956
|
---
|
|
951
957
|
|
|
952
958
|
### DNS Records
|
|
@@ -1022,55 +1028,53 @@ client.dns.delete(
|
|
|
1022
1028
|
|
|
1023
1029
|
---
|
|
1024
1030
|
|
|
1025
|
-
###
|
|
1026
|
-
|
|
1027
|
-
Manage email settings for users including forwarding rules.
|
|
1031
|
+
### Mail Settings
|
|
1028
1032
|
|
|
1029
|
-
|
|
1033
|
+
Per-employee settings: automatic contact collection, the sender name and
|
|
1034
|
+
signatures, and the auto-reply and forwarding rules.
|
|
1030
1035
|
|
|
1031
1036
|
```ruby
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
```
|
|
1037
|
+
# Automatic contact collection
|
|
1038
|
+
book = client.mail_settings.address_book(org_id: 1234567, user_id: 987654321)
|
|
1039
|
+
book.collect_addresses
|
|
1036
1040
|
|
|
1037
|
-
|
|
1041
|
+
client.mail_settings.update_address_book(
|
|
1042
|
+
org_id: 1234567, user_id: 987654321, collect_addresses: false
|
|
1043
|
+
)
|
|
1038
1044
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1045
|
+
# Sender name, default address and signatures
|
|
1046
|
+
info = client.mail_settings.sender_info(org_id: 1234567, user_id: 987654321)
|
|
1047
|
+
puts "#{info.from_name} <#{info.default_from}>"
|
|
1048
|
+
info.signs.each {|sign| puts sign.text }
|
|
1049
|
+
|
|
1050
|
+
client.mail_settings.update_sender_info(
|
|
1041
1051
|
org_id: 1234567,
|
|
1042
1052
|
user_id: 987654321,
|
|
1043
|
-
|
|
1044
|
-
|
|
1053
|
+
from_name: "Ivan Ivanov",
|
|
1054
|
+
sign_position: "under" # or "bottom", the default
|
|
1045
1055
|
)
|
|
1046
1056
|
```
|
|
1047
1057
|
|
|
1048
|
-
|
|
1058
|
+
Auto-replies and forwards are two kinds of the same rule and arrive together:
|
|
1049
1059
|
|
|
1050
1060
|
```ruby
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
user_id: 987654321
|
|
1055
|
-
)
|
|
1061
|
+
rules = client.mail_settings.rules(org_id: 1234567, user_id: 987654321)
|
|
1062
|
+
rules.autoreplies
|
|
1063
|
+
rules.forwards
|
|
1056
1064
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
# Add forwarding address
|
|
1062
|
-
client.post_settings.add_forwarding(
|
|
1063
|
-
org_id: 1234567,
|
|
1064
|
-
user_id: 987654321,
|
|
1065
|
-
address: "forward@example.com"
|
|
1065
|
+
# One rule per call, of one kind. An auto-reply:
|
|
1066
|
+
created = client.mail_settings.create_rule(
|
|
1067
|
+
org_id: 1234567, user_id: 987654321,
|
|
1068
|
+
rule_name: "On holiday", text: "Back on Monday"
|
|
1066
1069
|
)
|
|
1067
1070
|
|
|
1068
|
-
#
|
|
1069
|
-
client.
|
|
1070
|
-
org_id: 1234567,
|
|
1071
|
-
|
|
1072
|
-
address: "forward@example.com"
|
|
1071
|
+
# Or a forward:
|
|
1072
|
+
client.mail_settings.create_rule(
|
|
1073
|
+
org_id: 1234567, user_id: 987654321,
|
|
1074
|
+
rule_name: "To archive", address: "archive@example.com", with_store: true
|
|
1073
1075
|
)
|
|
1076
|
+
|
|
1077
|
+
client.mail_settings.delete_rule(org_id: 1234567, user_id: 987654321, rule_id: created.rule_id)
|
|
1074
1078
|
```
|
|
1075
1079
|
|
|
1076
1080
|
---
|
|
@@ -1219,51 +1223,33 @@ puts "Allowlist cleared"
|
|
|
1219
1223
|
|
|
1220
1224
|
### Two-Factor Authentication (2FA)
|
|
1221
1225
|
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
```ruby
|
|
1227
|
-
result = client.two_fa.enable(org_id: 1234567, user_id: 987654321)
|
|
1228
|
-
puts "2FA enabled successfully"
|
|
1229
|
-
```
|
|
1230
|
-
|
|
1231
|
-
#### Disable 2FA for a user
|
|
1232
|
-
|
|
1233
|
-
```ruby
|
|
1234
|
-
result = client.two_fa.disable(org_id: 1234567, user_id: 987654321)
|
|
1235
|
-
puts "2FA disabled successfully"
|
|
1236
|
-
```
|
|
1237
|
-
|
|
1238
|
-
#### Check user 2FA status
|
|
1226
|
+
Mandatory 2FA for the whole organization. All three calls share one path and
|
|
1227
|
+
differ only by verb, which is why there is no separate enable or disable
|
|
1228
|
+
endpoint.
|
|
1239
1229
|
|
|
1240
1230
|
```ruby
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1231
|
+
settings = client.two_fa.status(org_id: 1234567)
|
|
1232
|
+
settings.enabled
|
|
1233
|
+
settings.duration # seconds an employee may postpone setting it up
|
|
1234
|
+
settings.enabled_at
|
|
1245
1235
|
|
|
1246
|
-
|
|
1236
|
+
# duration is required: the API does not default it.
|
|
1237
|
+
client.two_fa.enable(
|
|
1238
|
+
org_id: 1234567,
|
|
1239
|
+
duration: 3600,
|
|
1240
|
+
logout_users: true, # optional, ends every session
|
|
1241
|
+
validation_method: "phone" # optional, "default" or "phone"
|
|
1242
|
+
)
|
|
1247
1243
|
|
|
1248
|
-
|
|
1249
|
-
domain_status = client.two_fa.domain_status(org_id: 1234567)
|
|
1250
|
-
puts "Domain 2FA enabled: #{domain_status.enabled}"
|
|
1244
|
+
client.two_fa.disable(org_id: 1234567)
|
|
1251
1245
|
```
|
|
1252
1246
|
|
|
1253
|
-
|
|
1247
|
+
Per-employee 2FA is not here. It belongs to the employee, so it lives on
|
|
1248
|
+
`users`:
|
|
1254
1249
|
|
|
1255
1250
|
```ruby
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
org_id: 1234567,
|
|
1259
|
-
enabled: true
|
|
1260
|
-
)
|
|
1261
|
-
|
|
1262
|
-
# Disable 2FA for entire domain
|
|
1263
|
-
result = client.two_fa.configure_domain(
|
|
1264
|
-
org_id: 1234567,
|
|
1265
|
-
enabled: false
|
|
1266
|
-
)
|
|
1251
|
+
client.users.get2FA(org_id: 1234567, user_id: 987654321)
|
|
1252
|
+
client.users.delete_2fa_phone(org_id: 1234567, user_id: 987654321)
|
|
1267
1253
|
```
|
|
1268
1254
|
|
|
1269
1255
|
---
|
|
@@ -1381,7 +1367,7 @@ date. See the sections above for what each one does.
|
|
|
1381
1367
|
|
|
1382
1368
|
```ruby
|
|
1383
1369
|
# Directory
|
|
1384
|
-
organizations.list
|
|
1370
|
+
organizations.list(page_size: 10, page_token: nil)
|
|
1385
1371
|
organizations.info(org_id:)
|
|
1386
1372
|
users.add(org_id:, dep_id:, **user_params)
|
|
1387
1373
|
users.add_alias(org_id:, user_id:, user_alias:)
|
|
@@ -1409,6 +1395,7 @@ groups.info(org_id:, group_id:)
|
|
|
1409
1395
|
groups.params(org_id:, group_id:) # deprecated, use info
|
|
1410
1396
|
groups.list(org_id:, page: 1, per_page: 10)
|
|
1411
1397
|
groups.users(org_id:, group_id:)
|
|
1398
|
+
groups.members(org_id:, group_id:)
|
|
1412
1399
|
groups.create(org_id:, name:, **group_params)
|
|
1413
1400
|
groups.delete(org_id:, group_id:)
|
|
1414
1401
|
groups.delete_user(org_id:, group_id:, type:, user_id:)
|
|
@@ -1421,22 +1408,27 @@ external_contacts.update_emails(org_id:, contact_id:, emails:)
|
|
|
1421
1408
|
external_contacts.update_phones(org_id:, contact_id:, phones:)
|
|
1422
1409
|
|
|
1423
1410
|
# Domains
|
|
1424
|
-
domains.list(org_id:)
|
|
1411
|
+
domains.list(org_id:, page: 1, per_page: 10)
|
|
1412
|
+
domains.find(org_id:, domain:)
|
|
1425
1413
|
domains.add(org_id:, name:, **params)
|
|
1426
|
-
domains.info(org_id:, domain:)
|
|
1427
1414
|
domains.delete(org_id:, domain:)
|
|
1428
|
-
domains.
|
|
1429
|
-
|
|
1415
|
+
domains.connection_status(org_id:, domain:)
|
|
1416
|
+
domains.dkim_status(org_id:, domain:)
|
|
1417
|
+
domains.enable_dkim(org_id:, domain:)
|
|
1418
|
+
domains.disable_dkim(org_id:, domain:)
|
|
1419
|
+
dns.list(org_id:, domain:, page: 1, per_page: 50)
|
|
1430
1420
|
dns.create(org_id:, domain:, **params)
|
|
1431
1421
|
dns.update(org_id:, domain:, record_id:, **params)
|
|
1432
1422
|
dns.delete(org_id:, domain:, record_id:)
|
|
1433
1423
|
|
|
1434
1424
|
# Mail
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1425
|
+
mail_settings.address_book(org_id:, user_id:)
|
|
1426
|
+
mail_settings.update_address_book(org_id:, user_id:, collect_addresses:)
|
|
1427
|
+
mail_settings.sender_info(org_id:, user_id:)
|
|
1428
|
+
mail_settings.update_sender_info(org_id:, user_id:, **params)
|
|
1429
|
+
mail_settings.rules(org_id:, user_id:)
|
|
1430
|
+
mail_settings.create_rule(org_id:, user_id:, **params)
|
|
1431
|
+
mail_settings.delete_rule(org_id:, user_id:, rule_id:)
|
|
1440
1432
|
mailboxes.shared_list(org_id:, page: 1, per_page: 10)
|
|
1441
1433
|
mailboxes.create_shared(org_id:, email:, name:, description:)
|
|
1442
1434
|
mailboxes.shared_info(org_id:, resource_id:)
|
|
@@ -1458,11 +1450,10 @@ antispam.create(org_id, *strings)
|
|
|
1458
1450
|
antispam.delete(org_id:)
|
|
1459
1451
|
|
|
1460
1452
|
# Security
|
|
1461
|
-
two_fa.
|
|
1462
|
-
two_fa.
|
|
1463
|
-
two_fa.
|
|
1453
|
+
two_fa.status(org_id:)
|
|
1454
|
+
two_fa.enable(org_id:, duration:, logout_users: nil, validation_method: nil)
|
|
1455
|
+
two_fa.disable(org_id:)
|
|
1464
1456
|
two_fa.domain_status(org_id:)
|
|
1465
|
-
two_fa.configure_domain(org_id:, enabled:)
|
|
1466
1457
|
sessions.info(org_id:)
|
|
1467
1458
|
sessions.update(org_id:, auth_ttl:)
|
|
1468
1459
|
sessions.logout(org_id:, user_id:)
|