app_store_connect_jwt 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e07c19923828b4b3eb63fff6535eac975ff798b2451c2121e8181b71707f5b68
4
- data.tar.gz: e945ab2468e8fe6924c3addd2739c3367074092c65e9834925ca44533af82d8e
3
+ metadata.gz: a6554123d78b28b5c860887eb931dd3d16d0726b028349fa3eed4b61ab70ac86
4
+ data.tar.gz: 84a806ff5b908e9d215cee2669a6cde014ec037b27c8f347469de164dc5ef15c
5
5
  SHA512:
6
- metadata.gz: 98cafd72c9a223bde023d6a5cb276ae59f2dddaf214c6491892e8eff23af240352cd57a3366d9ad49d13cccaeb175fedbafe871d5f4848d387fed1819db6c8d9
7
- data.tar.gz: 8aed3605393d115abe0badfa202473b88f6a477c2461a7b2e8d2a387f8b35ee3edfd5808c570bd746c5083b90c31f4af3ec9f265b30de293b048237bab893602
6
+ metadata.gz: a49956dac05a014e8cf93a63cf96522fb93c7b288b8ce52bae34ca65502af0ffeeac9665e625e4255d61b844c6547d1a3e4415bc4cd920d1436fe6a1d1eb88b4
7
+ data.tar.gz: e10a88e028d242bae182ddb2d4d8b1b9aa0fff24131af8bd658fb703e56d36edc5aedf04e8b24c99b32b20fdb612b29c131d05d5e0592d514682660ae6034671
@@ -30,10 +30,9 @@ jobs:
30
30
  GITHUB_PACKAGE_REPOSITORY_AUTH_TOKEN: ${{secrets.GITHUB_PACKAGE_REPOSITORY_AUTH_TOKEN}}
31
31
 
32
32
  - name: Build Gem
33
- run: |
34
- gem build *.gemspec
33
+ run: bundle exec rake build
35
34
  - name: Publish to RubyGems
36
- run: bundle exec ./bin/publish --rubygems
35
+ run: bundle exec rake push[rubygems]
37
36
 
38
37
  - name: Publish to Github Package Repository
39
- run: bundle exec ./bin/publish --github
38
+ run: bundle exec rake push[github]
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- app_store_connect_jwt (0.5.0)
4
+ app_store_connect_jwt (0.6.0)
5
5
  gli (~> 2.19)
6
6
  jwt (~> 2.2)
7
7
 
@@ -48,7 +48,7 @@ GEM
48
48
  coderay (~> 1.1.0)
49
49
  method_source (~> 0.9.0)
50
50
  rainbow (3.0.0)
51
- rake (10.5.0)
51
+ rake (13.0.1)
52
52
  rb-fsevent (0.10.3)
53
53
  rb-inotify (0.10.1)
54
54
  ffi (~> 1.0)
@@ -91,7 +91,7 @@ DEPENDENCIES
91
91
  bundler (~> 2.0)
92
92
  guard-rspec (~> 4.7)
93
93
  pry (~> 0.12)
94
- rake (~> 10.0)
94
+ rake (~> 13.0)
95
95
  rspec (~> 3.0)
96
96
  rubocop (~> 0.79)
97
97
  simplecov (~> 0.17)
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # App Store Connect–JWT
2
2
 
3
- ![Test](https://github.com/kyledecot/app_store_connect_jwt/workflows/Test/badge.svg) ![Lint](https://github.com/kyledecot/app_store_connect_jwt/workflows/Lint/badge.svg) [![Gem Version](https://badge.fury.io/rb/app_store_connect_jwt.svg)](https://badge.fury.io/rb/app_store_connect_jwt) [![Maintainability](https://api.codeclimate.com/v1/badges/e13c94f97898e74f34a9/maintainability)](https://codeclimate.com/github/kyledecot/hard_cider/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/e13c94f97898e74f34a9/test_coverage)](https://codeclimate.com/github/kyledecot/hard_cider/test_coverage)
3
+ ![Test](https://github.com/kyledecot/app_store_connect_jwt/workflows/Test/badge.svg) ![Lint](https://github.com/kyledecot/app_store_connect_jwt/workflows/Lint/badge.svg) [![Gem Version](https://badge.fury.io/rb/app_store_connect_jwt.svg)](https://badge.fury.io/rb/app_store_connect_jwt) [![Maintainability](https://api.codeclimate.com/v1/badges/e13c94f97898e74f34a9/maintainability)](https://codeclimate.com/github/kyledecot/app_store_connect_jwt/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/e13c94f97898e74f34a9/test_coverage)](https://codeclimate.com/github/kyledecot/app_store_connect_jwt/test_coverage)
4
4
 
5
- Generate App Store Connect API JWT (JSON Web Token) according to Apple's App Store Connect API Documentation:
5
+ Encode & decode App Store Connect API JWTs (JSON Web Tokens) according to Apple's Documentation:
6
6
 
7
7
  https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests
8
8
 
@@ -11,7 +11,7 @@ https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_f
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'app_store_connect_jwt'
14
+ gem 'app_store_connect_jwt', require: 'app_store_connect/jwt'
15
15
  ```
16
16
 
17
17
  And then execute:
@@ -24,60 +24,13 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
- ### CLI
28
-
29
- #### Encoding
30
-
31
- ```sh
32
- $ app-store-connect-jwt encode \
33
- --issuer-id=$APP_STORE_CONNECT_ISSUER_ID \
34
- --key-id=$APP_STORE_CONNECT_KEY_ID \
35
- --private-key-path=$APP_STORE_CONNECT_PRIVATE_KEY_PATH
36
- ```
37
-
38
- :information_desk_person: _Pro Tip: if you have the environment variables set that are listed above you can omit the flags entirely and the CLI will automatically pick up on them, thus making the command `app-store-connect-jwt encode`!_
39
-
40
- #### Decoding
41
-
42
- ```sh
43
- $ app-store-connect-jwt decode \
44
- --token="..." \
45
- --private-key-path=$APP_STORE_CONNECT_PRIVATE_KEY_PATH
46
- ```
47
-
48
- #### cURL
49
-
50
- ```sh
51
- $ curl -H "Authorization: Bearer $(app-store-connect-jwt encode)" \
52
- https://api.appstoreconnect.apple.com/v1/apps
53
- ```
54
-
55
- ### Ruby
56
-
57
- #### Encoding
58
-
59
- ```ruby
60
- AppStoreConnect::JWT.encode(
61
- issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"],
62
- key_id: ENV["APP_STORE_CONNECT_KEY_ID"],
63
- private_key_path: ENV["APP_STORE_CONNECT_PRIVATE_KEY_PATH"]
64
- )
65
- ```
66
-
67
- #### Decoding
68
-
69
- ```ruby
70
- AppStoreConnect::JWT.decode(
71
- token: token,
72
- private_key_path: ENV["APP_STORE_CONNECT_PRIVATE_KEY_PATH"]
73
- )
74
- ```
27
+ Check out the [Wiki](https://github.com/kyledecot/app_store_connect_jwt/wiki) for example usage.
75
28
 
76
29
  ## Development
77
30
 
78
31
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
79
32
 
80
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
33
+ To install this gem onto your local machine, run `bundle exec rake install`.
81
34
 
82
35
  ## Contributing
83
36
 
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
3
  require 'rspec/core/rake_task'
5
4
 
6
- RSpec::Core::RakeTask.new(:spec)
5
+ Dir.glob('lib/tasks/*.rake').each { |r| load r }
7
6
 
7
+ RSpec::Core::RakeTask.new(:spec)
8
8
  task default: :spec
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'bundler', '~> 2.0'
28
28
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
29
29
  spec.add_development_dependency 'pry', '~> 0.12'
30
- spec.add_development_dependency 'rake', '~> 10.0'
30
+ spec.add_development_dependency 'rake', '~> 13.0'
31
31
  spec.add_development_dependency 'rspec', '~> 3.0'
32
32
  spec.add_development_dependency 'rubocop', '~> 0.79'
33
33
  spec.add_development_dependency 'simplecov', '~> 0.17'
@@ -1,7 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'optparse'
5
4
  require 'app_store_connect/jwt/cli'
6
5
 
7
6
  exit AppStoreConnect::JWT::CLI.run(ARGV)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AppStoreConnect
4
4
  class JWT
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'app_store_connect/jwt/version'
4
+
5
+ desc "Build app_store_connect_jwt-#{AppStoreConnect::JWT::VERSION}.gem"
6
+ task :build do
7
+ sh 'gem build app_store_connect_jwt.gemspec'
8
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pry'
4
+ require 'app_store_connect/jwt'
5
+
6
+ desc 'Start a pry console'
7
+ task :console do
8
+ Pry.start(AppStoreConnect::JWT)
9
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'app_store_connect/jwt/version'
4
+
5
+ HOSTS_BY_KEY = {
6
+ rubygems: 'https://rubygems.org',
7
+ github: 'https://rubygems.pkg.github.com/kyledecot'
8
+ }.freeze
9
+
10
+ desc "Push app_store_connect_jwt-#{AppStoreConnect::JWT::VERSION}.gem"
11
+ task :push, [:key] do |_task, args|
12
+ args.with_defaults(key: 'rubygems')
13
+
14
+ sh(
15
+ 'gem push',
16
+ "--key=#{args.key}",
17
+ "--host=#{HOSTS_BY_KEY.fetch(args.key.to_sym)}",
18
+ "app_store_connect_jwt-#{AppStoreConnect::JWT::VERSION}.gem"
19
+ )
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_store_connect_jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Decot
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-21 00:00:00.000000000 Z
11
+ date: 2020-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -177,8 +177,6 @@ files:
177
177
  - README.md
178
178
  - Rakefile
179
179
  - app_store_connect_jwt.gemspec
180
- - bin/console
181
- - bin/publish
182
180
  - bin/setup
183
181
  - exe/app-store-connect-jwt
184
182
  - lib/app_store_connect.rb
@@ -186,6 +184,9 @@ files:
186
184
  - lib/app_store_connect/jwt/cli.rb
187
185
  - lib/app_store_connect/jwt/utils.rb
188
186
  - lib/app_store_connect/jwt/version.rb
187
+ - lib/tasks/build.rake
188
+ - lib/tasks/console.rake
189
+ - lib/tasks/push.rake
189
190
  homepage: https://github.com/kyledecot/app_store_connect_jwt
190
191
  licenses:
191
192
  - MIT
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'pry'
5
- require 'app_store_connect/jwt'
6
-
7
- Pry.start(AppStoreConnect::JWT)
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'optparse'
5
- require 'app_store_connect/jwt/version'
6
-
7
- OPTIONS = {
8
- hosts: [],
9
- version: AppStoreConnect::JWT::VERSION
10
- }
11
-
12
- HOSTS = {
13
- rubygems: 'https://rubygems.org',
14
- github: 'https://rubygems.pkg.github.com/kyledecot'
15
- }.freeze
16
-
17
- OptionParser.new do |parser|
18
- HOSTS.keys.each do |key|
19
- parser.on("--#{key}") do
20
- OPTIONS[:hosts] << key
21
- end
22
- end
23
-
24
- parser.on('--version VERSION') do |version|
25
- OPTIONS[:version] = version
26
- end
27
-
28
- parser.on('--help', '-h') do
29
- puts parser
30
- exit(0)
31
- end
32
- end.parse!
33
-
34
- OPTIONS[:hosts].each do |key|
35
- ENV['RUBYGEMS_HOST'] = HOSTS.fetch(key)
36
-
37
- system "gem push -k #{key} app_store_connect_jwt-#{OPTIONS[:version]}.gem"
38
- end