You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit df1960b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
### Changelog
2
2
3
-
### 2.2.2 (Next)
3
+
### 2.3.0 (Next)
4
4
5
+
*[#183](https://github.com/slack-ruby/slack-ruby-bot-server/pull/183): Add a `config.server_pages` block to configure page middleware options centrally without changing the installed library's defaults - [@dblock](https://github.com/dblock), [@Copilot](https://github.com/apps/copilot-swe-agent).
-[Sample Bots Using Slack Ruby Bot Server](#sample-bots-using-slack-ruby-bot-server)
32
33
-[Copyright & License](#copyright--license)
@@ -307,6 +308,25 @@ SlackRubyBotServer.configure do |config|
307
308
end
308
309
```
309
310
311
+
#### Page Middleware Configuration
312
+
313
+
Use `config.server_pages` to configure the underlying [`Rack::ServerPages`](https://github.com/migrs/rack-server-pages) middleware in an initializer, before `SlackRubyBotServer::Api::Middleware.instance` is first accessed. The block receives its configuration object after the framework applies `view_paths`, so it can customize any option supported by your installed `rack-server-pages` version.
314
+
315
+
For example, with `rack-server-pages` 0.3.0 or newer:
316
+
317
+
```ruby
318
+
SlackRubyBotServer.configure do |config|
319
+
config.server_pages do |pages|
320
+
pages.cache_control ='private, no-cache'
321
+
pages.static_cache_control ='public, no-cache'
322
+
end
323
+
end
324
+
```
325
+
326
+
`cache_control` sets the default `Cache-Control` header for rendered templates, including generated CSS. `static_cache_control` sets it for static files. `no-cache` allows storage but requires revalidation before reuse; use `private, no-store` for sensitive pages. You can also configure `static_etags` and `static_timestamps` with version 0.3.0 or newer. These settings do not change downstream API responses.
327
+
328
+
Without a block, the framework preserves the installed library's defaults and existing `view_paths` behavior. Registering another block replaces the previous one, and `SlackRubyBotServer::Config.reset!` clears it. The block runs when the middleware stack is built, not on each request. If you change configuration after initialization, rebuild the stack with `SlackRubyBotServer::Api::Middleware.reset!`; configure it before startup in production.
329
+
310
330
### Access Tokens
311
331
312
332
By default the implementation of [Team](lib/slack-ruby-bot-server/models/team) stores the value of the token with all the requested OAuth scopes in both `token` and `activated_user_access_token` (for backwards compatibility), along with `oauth_version` and `oauth_scope`. If a legacy Slack bot integration `bot_access_token` is present, it is stored as `token`, and `activated_user_access_token` is the token that has all the requested OAuth scopes.
0 commit comments