Skip to content

Commit

Permalink
πŸ“¦ v2.6.0
Browse files Browse the repository at this point in the history
- 🀝 Compatibility with `[email protected].*`;
- πŸ“‹ Documentation update regarding `SameSite` option;
- πŸ‘¨β€πŸ”¬ Test-suite minor update;
- πŸ“¦ Internal Meteor dependencies update;

__Changed:__

- ✨ `SameSite` option now accepts *String* (and *Boolean* for backward
compatibility) to comply with [new
guidelines](https://web.dev/samesite-cookie-recipes/). Suggested
values: `None`, `Strict`, and `Lax`.
  • Loading branch information
dr-dimitru committed Mar 2, 2020
1 parent 5de353b commit 9553460
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
30 changes: 15 additions & 15 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
[email protected]
babel-compiler@7.3.4
babel-runtime@1.3.0
[email protected].11
babel-compiler@7.5.2
babel-runtime@1.5.0
[email protected].12
[email protected]
[email protected]
callback-hook@1.1.0
callback-hook@1.3.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
ecmascript@0.12.4
ecmascript@0.14.2
[email protected]
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
[email protected].0
ecmascript-runtime-client@0.10.0
ecmascript-runtime-server@0.9.0
[email protected].1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
local-test:ostrio:cookies@2.5.0
local-test:ostrio:cookies@2.6.0
[email protected]
[email protected]
[email protected]
[email protected]
modules@0.13.0
modules-runtime@0.10.3
mongo@1.6.2
modules@0.15.0
modules-runtime@0.12.0
mongo@1.8.0
[email protected]
[email protected]
[email protected]
npm-mongo@3.1.2
npm-mongo@3.3.0
[email protected]
ostrio:cookies@2.5.0
ostrio:cookies@2.6.0
[email protected]
[email protected]
[email protected]
Expand All @@ -46,5 +46,5 @@ [email protected]
[email protected]
[email protected]
[email protected]
webapp@1.7.3
webapp@1.8.0
[email protected]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Create/overwrite a cookie.
- `opts.domain` {*String*} - [Optional] The domain from where the cookie will be readable. E.g., "example.com", ".example.com" (includes all subdomains) or "subdomain.example.com"; if not specified, defaults to the host portion of the current document location (string or null)
- `opts.secure` {*Boolean*} - [Optional] The cookie will be transmitted only over secure protocol as `https`
- `opts.httpOnly` {*Boolean*} - [Optional] An HttpOnly cookie cannot be accessed by client-side APIs, such as JavaScript. This restriction eliminates the threat of cookie theft via cross-site scripting (XSS)
- `opts.sameSite` {*Boolean*} - [Optional] Cookie which can only be sent in requests originating from the same origin as the target domain. Read more on [wikipedia](https://en.wikipedia.org/wiki/HTTP_cookie#SameSite_cookie) and [ietf](https://tools.ietf.org/html/draft-west-first-party-cookies-05)
- `opts.sameSite` {*Boolean*} {*String*: *None*, *Strict*, or *Lax*} - [Optional] Cross-site cookies usage policy. Read more on [wikipedia](https://en.wikipedia.org/wiki/HTTP_cookie#SameSite_cookie), [web.dev](https://web.dev/samesite-cookies-explained/), and [ietf](https://tools.ietf.org/html/draft-west-first-party-cookies-05). Default: `false`
- `opts.firstPartyOnly` {*Boolean*} - [Optional] *Deprecated use `sameSite` instead*

### `cookies.remove([key], [path], [domain])` [*Isomorphic*]
Expand Down
2 changes: 1 addition & 1 deletion cookies-tests.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EJSON } from 'meteor/ejson';
import { Meteor } from 'meteor/meteor';
import { Cookies } from 'meteor/ostrio:cookies';
import { Cookies } from './cookies.js';

let WebApp;
const antiCircular = (_obj) => {
Expand Down
2 changes: 1 addition & 1 deletion cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const serialize = (key, val, opt = {}) => {
}

if (opt.sameSite) {
pairs.push('SameSite');
pairs.push(opt.sameSite === true ? 'SameSite' : `SameSite=${opt.sameSite}`);
}

return { cookieString: pairs.join('; '), sanitizedValue };
Expand Down
4 changes: 2 additions & 2 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'ostrio:cookies',
version: '2.5.0',
version: '2.6.0',
summary: 'Isomorphic bulletproof Server, Client, Browser and Cordova cookies',
git: 'https://github.com/VeliovGroup/Meteor-Cookies',
documentation: 'README.md'
Expand All @@ -16,7 +16,7 @@ Package.onUse((api) => {

Package.onTest((api) => {
api.use('tinytest');
api.use(['ecmascript', 'ostrio:cookies'], ['client', 'server']);
api.use(['ecmascript', 'http'], ['client', 'server']);
api.use(['ejson', 'webapp'], 'server');
api.addFiles('cookies-tests.js', ['client', 'server']);
});

0 comments on commit 9553460

Please sign in to comment.