mailtrap 2.15.0 → 2.16.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 +11 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/mailtrap/api_tokens_api.rb +13 -3
- data/lib/mailtrap/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a727114a65c3b0d37de9dcc946d8e5d7d0c5c786b408844c4d399b9ae8caa32
|
|
4
|
+
data.tar.gz: 0ca0ebb87fe19a6d1a59268da9ba4b5f7cbe5c85224236764aa94dad103d6dc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3b319869ad41f336475b58a86ef8d2b4c4e13979ae740690b5b4f95429b0094b0387ea7e1cde605085735e61bcc710af7c2424a7a7b44144c7db9fedb265ebd
|
|
7
|
+
data.tar.gz: 3d93fccceadcf06720feda85ff17ff2278df6f1a93f6b734e14e57f7a4d843b77cda69f88c350290f415474920a70c63056a6446265cba1e0d56c2601c7ffd02
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.16.0] - 2026-08-31
|
|
2
|
+
|
|
3
|
+
## What's Changed
|
|
4
|
+
* MT-23076: support expires_at for api token create and reset by @oshchyhol in https://github.com/mailtrap/mailtrap-ruby/pull/122
|
|
5
|
+
* MT-23762: redact api token values from VCR cassettes by @oshchyhol in https://github.com/mailtrap/mailtrap-ruby/pull/125
|
|
6
|
+
|
|
7
|
+
## New Contributors
|
|
8
|
+
* @oshchyhol made their first contribution in https://github.com/mailtrap/mailtrap-ruby/pull/122
|
|
9
|
+
|
|
10
|
+
**Full Changelog**: https://github.com/mailtrap/mailtrap-ruby/compare/v2.15.0...v2.16.0
|
|
11
|
+
|
|
1
12
|
## [2.15.0] - 2026-08-28
|
|
2
13
|
|
|
3
14
|
## What's Changed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -208,7 +208,9 @@ General:
|
|
|
208
208
|
|
|
209
209
|
- Accounts API – [`accounts_api.rb`](examples/accounts_api.rb)
|
|
210
210
|
- Account Accesses API – [`account_accesses_api.rb`](examples/account_accesses_api.rb)
|
|
211
|
+
- API Tokens API – [`api_tokens_api.rb`](examples/api_tokens_api.rb)
|
|
211
212
|
- Billing API – [`billing_api.rb`](examples/billing_api.rb)
|
|
213
|
+
- Permissions API – [`permissions_api.rb`](examples/permissions_api.rb)
|
|
212
214
|
- Templates API – [`email_templates_api.rb`](examples/email_templates_api.rb)
|
|
213
215
|
- Action Mailer – [`action_mailer.rb`](examples/action_mailer.rb)
|
|
214
216
|
- Verifying webhook signatures – [`webhooks_signature_verification.ru`](examples/webhooks_signature_verification.ru)
|
|
@@ -7,7 +7,7 @@ module Mailtrap
|
|
|
7
7
|
class ApiTokensAPI
|
|
8
8
|
include BaseAPI
|
|
9
9
|
|
|
10
|
-
self.supported_options = %i[name resources].freeze
|
|
10
|
+
self.supported_options = %i[name expires_at resources].freeze
|
|
11
11
|
|
|
12
12
|
self.response_class = ApiToken
|
|
13
13
|
|
|
@@ -30,6 +30,9 @@ module Mailtrap
|
|
|
30
30
|
# Creates a new API token. The full `token` value is returned ONLY ONCE — store it securely.
|
|
31
31
|
# @param [Hash] options The parameters to create
|
|
32
32
|
# @option options [String] :name Display name for the token
|
|
33
|
+
# @option options [String, nil] :expires_at Optional token expiration as an ISO 8601 date-time.
|
|
34
|
+
# Omit for the server default (a 1-year default is being rolled out). Pass explicit nil for
|
|
35
|
+
# a token that never expires. Past or more-than-5-years-ahead values are rejected with 422
|
|
33
36
|
# @option options [Array<Hash>] :resources Permissions to assign
|
|
34
37
|
# - `{ resource_type:, resource_id:, access_level: }`
|
|
35
38
|
# @return [ApiToken] Created token (full `token` value populated)
|
|
@@ -43,10 +46,17 @@ module Mailtrap
|
|
|
43
46
|
# The old token stops working after a short grace period. The new `token` value is
|
|
44
47
|
# returned ONLY ONCE — store it securely
|
|
45
48
|
# @param token_id [Integer] The API token ID
|
|
49
|
+
# @param [Hash] options The reset parameters
|
|
50
|
+
# @option options [String, nil] :expires_at Optional token expiration as an ISO 8601 date-time.
|
|
51
|
+
# Omit for the server default (a 1-year default is being rolled out). Pass explicit nil for
|
|
52
|
+
# a token that never expires. Past or more-than-5-years-ahead values are rejected with 422
|
|
46
53
|
# @return [ApiToken] New token (full `token` value populated)
|
|
47
54
|
# @!macro api_errors
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
# @raise [ArgumentError] If invalid options are provided
|
|
56
|
+
def reset(token_id, options = {})
|
|
57
|
+
validate_options!(options, %i[expires_at])
|
|
58
|
+
# An empty hash must not be sent as a body — the endpoint historically takes no body
|
|
59
|
+
response = client.post("#{base_path}/#{token_id}/reset", options.empty? ? nil : options)
|
|
50
60
|
handle_response(response)
|
|
51
61
|
end
|
|
52
62
|
|
data/lib/mailtrap/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mailtrap
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.16.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Railsware Products Studio LLC
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|