faye-authentication 1.12 → 1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/assets/javascripts/faye-authentication.js +1 -1
- data/lib/faye/authentication.rb +1 -1
- data/spec/javascripts/faye-authentication_spec.js +8 -0
- data/spec/lib/faye/authentication_spec.rb +5 -0
- 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: 7df2f00525686219899b087a97cd26dda4d0beb817de711c7009e0b1f2d73172
|
4
|
+
data.tar.gz: 87ed8fcf147384cf3c2a2f43ef32488e0592cac79e00f5360b4dd4b95d40bde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b3cd29b0f5384af09976d723a30d2878e172ff15a9c125b109b27ff3592ce684446474799f8e035664cdc9af0458d005143ef05fed3539b31347a3eed627a5a
|
7
|
+
data.tar.gz: fba06b490b06c432ea3fdd7bd897c55f75f1ee2e20c7e68f59e8900037a454d007a1665ec251d04fc83387540e152ee459cfae4c1296909fa3b68db697ba07b2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Faye::Authentication [![Build Status](https://travis-ci.org/jarthod/faye-authentication.svg?branch=master)](https://travis-ci.org/
|
1
|
+
# Faye::Authentication [![Build Status](https://travis-ci.org/jarthod/faye-authentication.svg?branch=master)](https://travis-ci.org/jarthod/faye-authentication)
|
2
2
|
|
3
3
|
Authentification implementation for faye
|
4
4
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.13
|
@@ -92,7 +92,7 @@ FayeAuthentication.prototype.outgoing = function(message, callback) {
|
|
92
92
|
|
93
93
|
FayeAuthentication.prototype.authentication_required = function(message) {
|
94
94
|
var subscription_or_channel = message.subscription || message.channel;
|
95
|
-
if (message.channel
|
95
|
+
if (message.channel.lastIndexOf('/meta/subscribe') === 0 || message.channel.lastIndexOf('/meta/', 0) !== 0) {
|
96
96
|
if(this._options.whitelist) {
|
97
97
|
try {
|
98
98
|
return (!this._options.whitelist(subscription_or_channel));
|
data/lib/faye/authentication.rb
CHANGED
@@ -42,7 +42,7 @@ module Faye
|
|
42
42
|
def self.authentication_required?(message, options = {})
|
43
43
|
subscription_or_channel = message['subscription'] || message['channel']
|
44
44
|
return false if message['channel'].nil?
|
45
|
-
return false unless (message['channel']
|
45
|
+
return false unless (message['channel'].start_with?('/meta/subscribe') || (!(message['channel'].start_with?('/meta/'))))
|
46
46
|
whitelist_proc = options[:whitelist]
|
47
47
|
if whitelist_proc
|
48
48
|
begin
|
@@ -94,6 +94,14 @@ describe('faye-authentication', function() {
|
|
94
94
|
sharedExamplesForSubscribeAndPublish();
|
95
95
|
});
|
96
96
|
|
97
|
+
describe('subscribe with prefix', function() {
|
98
|
+
beforeEach(function() {
|
99
|
+
this.message = {'channel': '/meta/subscribe/x', 'subscription': '/foobar'};
|
100
|
+
});
|
101
|
+
|
102
|
+
sharedExamplesForSubscribeAndPublish();
|
103
|
+
});
|
104
|
+
|
97
105
|
describe('handshake', function() {
|
98
106
|
beforeEach(function() {
|
99
107
|
this.message = {'channel': '/meta/handshake'};
|
@@ -132,6 +132,11 @@ describe Faye::Authentication do
|
|
132
132
|
it_behaves_like 'subscribe_and_publish'
|
133
133
|
end
|
134
134
|
|
135
|
+
context 'subscribe with prefix' do
|
136
|
+
let(:message) { {'channel' => '/meta/subscribe/x', 'subscription' => '/foobar'} }
|
137
|
+
it_behaves_like 'subscribe_and_publish'
|
138
|
+
end
|
139
|
+
|
135
140
|
context 'handshake' do
|
136
141
|
let(:message) { {'channel' => '/meta/handshake'} }
|
137
142
|
it_behaves_like 'meta_except_subscribe'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faye-authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Siami
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2020-
|
14
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: jwt
|