jekyll-crypto 0.1.0 → 0.1.1

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: cca422051de6e5d9b10f15ea16bd9ae78138984a00c46848578ea2aa74be17f4
4
- data.tar.gz: 9fcbc0574712ef3fab4d5c935d89bb3fb4f249e632b92fd101ab15e96132e8d8
3
+ metadata.gz: c244f68e8ba99e94404b86353e875884ab38f7e33e203bf1d4046a6ca5a95245
4
+ data.tar.gz: 1ac0f13f09bea3e620cc90d668d0da3586e691c1a0988269f3d16190ca9cf89f
5
5
  SHA512:
6
- metadata.gz: a7ea860825f036aea83b9c5ec2d0ca52c88343646deb1c0c58382a43c4d5139dc70ece915d637dc7beb939bffc38aaca666bf4cab7991c3233cb06a9f1b01e30
7
- data.tar.gz: 3522f200a9768d0e972133ea7cf0fb5f3fd77c1a1b04000623cff4e82a2bd88f3f76405f48967ccc70b2fb3962eac97f8858a124f49bde4a0d922f84291ad983
6
+ metadata.gz: 8710c518b56ced5ed121ef7987b499746fd5ea78ba01488ac981ba59c37d689747c2ff59784f8dbd9cb8ccdf0f19c43ba3d66f0cf4ca541857fd30036da00993
7
+ data.tar.gz: e3f6c927325197d3c38081dd78c0d08713c7a3288c7364e43ce714ec2cf0e8c8975698be8fd611d799da9c17b31e10d2d8ecf3a4bc87664c24ebebe0c6c47e2d
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 - 2020-03-06
4
+
5
+ * Prevent password autocompletion
6
+
7
+ * Make encryption optional specifying `password: false` in front matter.
8
+
9
+ ## 0.1.0 - 2020-03-04
10
+
11
+ First release! Posts contents are encrypted and authenticated with
12
+ AES-GCM-256 and passwords are hashed with PBKDF2-SHA256.
data/README.md CHANGED
@@ -44,6 +44,10 @@ version, the decryption parameters and a Javascript snippet that asks
44
44
  visitors for a password. If the password is correct, the content is
45
45
  replaced by the plain text version :)
46
46
 
47
+ You can prevent an article from being encrypted by setting password to
48
+ `false`. It also accepts the string `'false'`. So this means you can't
49
+ use "false" as a password :P
50
+
47
51
  ## Development
48
52
 
49
53
  After checking out the repo, run `bin/setup` to install
@@ -144,7 +144,7 @@ module Jekyll
144
144
  data-auth-data="#{JSON.dump auth_data.bytes}">
145
145
 
146
146
  <form>
147
- <input type="password" name="password" />
147
+ <input type="password" name="password" autocomplete="off" />
148
148
  <input type="submit" />
149
149
  </form>
150
150
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
- module Crypto
3
- VERSION = '0.1.0'.freeze
2
+ class Crypto
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,4 @@
1
1
  require 'jekyll/renderer'
2
- require 'pry'
3
2
 
4
3
  module Jekyll
5
4
  # Renders a Document
@@ -14,12 +13,22 @@ module Jekyll
14
13
 
15
14
  # Encrypts the content before it's placed into the layout tree
16
15
  def place_in_layouts(content, payload, info)
17
- unless content.chomp.empty?
16
+ if encrypt?
18
17
  crypto = Crypto.new(site: site, post: document)
19
18
  crypto.encrypt! && crypto.valid?
20
19
  end
21
20
 
22
21
  place_in_layouts_orig document.content, payload, info
23
22
  end
23
+
24
+ private
25
+
26
+ def encrypt?
27
+ return false if document.data['password'] == false
28
+ return false if document.data['password'] == 'false'
29
+ return false if document.content.chomp.empty?
30
+
31
+ true
32
+ end
24
33
  end
25
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-crypto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -89,8 +89,10 @@ executables: []
89
89
  extensions: []
90
90
  extra_rdoc_files:
91
91
  - README.md
92
+ - CHANGELOG.md
92
93
  - LICENSE.txt
93
94
  files:
95
+ - CHANGELOG.md
94
96
  - LICENSE.txt
95
97
  - README.md
96
98
  - lib/jekyll-crypto.rb