oauth_im 0.4.6 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e28d71eba7b82be12370b581d9d18e1586c306f9289b652c01840b5741c390b1
4
- data.tar.gz: a00df7c4945ba074f7493f727bed3a9b7b2404743d5f7b41f240e2042242530b
3
+ metadata.gz: b70eeabdc9f6da4c58f0bf9dd7f1eae8be61ce49a7d2d000967e99a91c2e62cd
4
+ data.tar.gz: cb8331b086b26d0a134f5560e4f9ceb94f7f529b6a4beaa154bc411a8743b1d1
5
5
  SHA512:
6
- metadata.gz: fbcb705e404198de143fc4be4cfc0d3e61565d8e65786e856b0d0b562d86071cd686288ebb262db4d1b0e5433a2b7cf05da0d03746619114510f0e04e719cae8
7
- data.tar.gz: fde29ac8263407ec2cce0d17d90ef85fa916e8d92ae8cc97b26335206b8b6c30c517c60b2af256ccdf16eea50fba7f8e94f1d727a77f6704002b62a3a4a2b313
6
+ metadata.gz: 482b2622fe4341c8f74d7eb7278086f876c390ee017396d5f26bd097dafcf3d888190e1bcfbddccc6d2e8e0948a37e0d27590446bbc5d8b1649b84f04084d967
7
+ data.tar.gz: 53e759edf05fea4c84f0d9d043f7dc1d9bdb41b4ef19336c537e4dac5c185587760c105bfef2f21d1f1be527dc5904378b5967e2e4c164d9395e9771d7dac355
data/README.md CHANGED
@@ -79,7 +79,53 @@ some other appropriate location, e.g.:
79
79
  class ApplicationController < ActionController::Base
80
80
  include OauthIm::Authenticable
81
81
 
82
- # etc. etc. etc.
82
+ # etc.
83
83
  end
84
-
85
84
  ```
85
+
86
+ ### Initializer
87
+ * The gem provides a single initializer, `AppContext`.
88
+ * This module is **not** name-spaced.
89
+ * It provides a single method, `provide_authentication?`, which by
90
+ default is `true`.
91
+ * Client apps can override this initializer method.
92
+ * For example, `iiab` overrides this initializer so that the
93
+ `provide_authentication?` method returns `false` unless the app is
94
+ `kh_iiab` (not `demo_im`).
95
+
96
+ ## Gem Maintenance
97
+ After many false starts, this repo includes two (seemingly functional) github workflows.
98
+
99
+ 1. Thanks to [this workflow](https://github.com/illustrativemathematics/oauth_im/blob/main/.github/workflows/ci.yml),
100
+ largely copied from the CMS, the specs should run automatically when a PR is issued.
101
+ 2. Thanks to [this workflow](https://github.com/illustrativemathematics/oauth_im/blob/main/.github/workflows/release.yml)
102
+ based on [this blog post](https://andrewm.codes/blog/automating-ruby-gem-releases-with-github-actions/)
103
+ and using [this release phase action](https://github.com/illustrativemathematics/oauth_im/blob/main/.github/workflows/release.yml),
104
+ certain so-called [conventional commits](https://github.com/google-github-actions/release-please-action#how-should-i-write-my-commits)
105
+ will result in a so-called **release PR**.
106
+ * Per the above documentation, to issue such a commit, use the following format for your commit message:
107
+ * `fix: a comment about a minor change that corresponds to a SemVar patch`
108
+ * `feat: a comment about a feature change that corresponds to a SemVar minor`
109
+ * `fix!: a comment about a breaking change that corresponds to a Semvar major`
110
+ * `feat!: ditto`
111
+ * Once a release PR is accepted and merged, a new PR is created that does several things:
112
+ * The gem is versioned by updating [the version file](https://github.com/illustrativemathematics/oauth_im/blob/main/lib/oauth_im/version.rb#L4).
113
+ * The new PR also includes auto-generated updates to [CHANGELOG.md](https://github.com/illustrativemathematics/oauth_im/blob/main/CHANGELOG.md).
114
+ * If this new PR is accepted and merged, several other things happened:
115
+ * A new tag and github release are created.
116
+ * The new gem version is automatically pushed up to Rubygems.
117
+
118
+ ### Notes
119
+ * Because the above process adds new commits to the repository, you
120
+ should remember to pull them.
121
+ * At Rubygems it is difficult to reuse version numbers for gems. For
122
+ this reason, you shouldn't try to force-push updates to gem version
123
+ numbers. Instead, let the automatic process manage versioning for
124
+ you.
125
+
126
+ ## Version History
127
+
128
+ ### 0.6.0
129
+ * Remove coupling between gem and `iiab` app via the `AppContext`
130
+ module. Added default `AppContext` settings to be overridden in
131
+ client app (in this case, `iiab`).
@@ -12,7 +12,7 @@ module OauthIm
12
12
  private
13
13
 
14
14
  def authenticated?
15
- AppContext.kh_iiab? && logged_in?
15
+ AppContext.provide_authentication? && logged_in?
16
16
  end
17
17
 
18
18
  def email
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AppContext
4
+ def self.provide_authentication?
5
+ true
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.4.6'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth_im
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Connally
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-14 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -127,6 +127,7 @@ files:
127
127
  - app/helpers/oauth_im/application_helper.rb
128
128
  - app/services/oauth_im/token_decoder.rb
129
129
  - app/views/layouts/oauth_im/application.html.erb
130
+ - config/initializers/app_context.rb
130
131
  - config/routes.rb
131
132
  - lib/oauth_im.rb
132
133
  - lib/oauth_im/configuration.rb
@@ -137,9 +138,10 @@ homepage: https://github.com/illustrativemathematics/oauth_im
137
138
  licenses:
138
139
  - BSD-3-Clause
139
140
  metadata:
141
+ changelog_uri: https://github.com/illustrativemathematics/oauth_im
140
142
  homepage_uri: https://github.com/illustrativemathematics/oauth_im
141
143
  source_code_uri: https://github.com/illustrativemathematics/oauth_im
142
- changelog_uri: https://github.com/illustrativemathematics/oauth_im
144
+ rubygems_mfa_required: 'true'
143
145
  post_install_message:
144
146
  rdoc_options: []
145
147
  require_paths: