Skip to content

Commit 9404243

Browse files
committed
Merge branch 'release/0.2.0'
2 parents fc8ba3f + 5188848 commit 9404243

8 files changed

Lines changed: 25 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ jobs:
1515
matrix:
1616
ruby:
1717
- "2.7.8"
18-
- "3.0.6"
19-
- "3.1.4"
20-
- "3.2.2"
18+
- "3.0.7"
19+
- "3.1.7"
20+
- "3.2.9"
21+
- "3.3.9"
22+
- "3.4.7"
2123

2224
steps:
2325
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Changelog
22

3-
## [0.1.1](https://github.com/appercept/cognito_idp-ruby/tree/0.1.1) (2023-12-07)
3+
## [0.2.0](https://github.com/appercept/cognito_idp-ruby/tree/0.2.0) (2025-11-19)
44

5-
[Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.0...0.1.1)
5+
[Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.1...0.2.0)
6+
7+
**Merged pull requests:**
8+
9+
- feat: Add CognitoIdp::Token\#refresh\_token [\#3](https://github.com/appercept/cognito_idp-ruby/pull/3) ([rhatherall](https://github.com/rhatherall))
10+
11+
## [v0.1.1](https://github.com/appercept/cognito_idp-ruby/tree/v0.1.1) (2023-12-07)
12+
13+
[Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.0...v0.1.1)
614

715
**Fixed bugs:**
816

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CognitoIdp
1+
# CognitoIdp [![Ruby](https://github.com/appercept/cognito_idp-ruby/actions/workflows/main.yml/badge.svg)](https://github.com/appercept/cognito_idp-ruby/actions/workflows/main.yml)
22

33
Client for interacting with Amazon Cognito IdP (User Pools) endpoints.
44

cognito_idp-client.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
3030
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3131
spec.require_paths = ["lib"]
3232

33+
spec.add_dependency "base64"
3334
spec.add_dependency "faraday", "~> 2.7"
3435

3536
# For more information and examples about making a new gem, check out our

lib/cognito_idp/client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require "base64"
34
require "faraday"
45

56
module CognitoIdp

lib/cognito_idp/token.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
module CognitoIdp
44
class Token
5-
attr_reader :access_token, :id_token, :token_type, :expires_at, :expires_in
5+
attr_reader :access_token, :id_token, :token_type, :expires_at, :expires_in, :refresh_token
66

77
def initialize(token_hash)
88
token_hash.transform_keys(&:to_sym).tap do |values|
99
@access_token = values[:access_token]
1010
@id_token = values[:id_token]
1111
@token_type = values[:token_type]
1212
@expires_in = values[:expires_in]
13+
@refresh_token = values[:refresh_token]
1314
end
1415
@expires_at = Time.now + expires_in unless expires_in.nil?
1516
end

lib/cognito_idp/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module CognitoIdp
4-
VERSION = "0.1.1"
4+
VERSION = "0.2.0"
55
end

spec/cognito_idp/token_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
it { expect(token.token_type).to be_nil }
1515
it { expect(token.expires_in).to be_nil }
1616
it { expect(token.expires_at).to be_nil }
17+
it { expect(token.refresh_token).to be_nil }
1718

1819
context "when token is initialized with values" do
1920
let(:token_hash) do
2021
{
2122
"access_token" => "eyJra1example",
2223
"id_token" => "eyJra2example",
2324
"token_type" => "Bearer",
24-
"expires_in" => 3600
25+
"expires_in" => 3600,
26+
"refresh_token" => "refresh-token-1"
2527
}
2628
end
2729

@@ -38,5 +40,6 @@
3840
it { expect(token.token_type).to eq("Bearer") }
3941
it { expect(token.expires_in).to eq(3600) }
4042
it { expect(token.expires_at).to eq(Time.now + 3600) }
43+
it { expect(token.refresh_token).to eq("refresh-token-1") }
4144
end
4245
end

0 commit comments

Comments
 (0)