- Always verify the signature before you trust any information in the JWT
- If possible, implement IP Whitelisting using the Access Control policy for additional security when using query params.
- pass Cache-Control:No-Store in the HTTP Headers
- Do not send tokens over non-HTTPS connections as those requests can be intercepted and tokens compromised. SSL will protect the query parameters in transit;
- Give tokens an expiration. Technically, once a token is signed – it is valid forever – unless the signing key is changed or expiration explicitly set. This could pose potential issues so have a strategy for expiring and/or revoking tokens.
- Do not add sensitive data to the payload. Tokens are signed to protect against manipulation and are easily decoded. Add the bare minimum number of claims to the payload for best performance and security.
- Secure the secret signing key used for calculating and verifying the signature. The secret signing key should only be accessible by the issuer an
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# allows font-awesome fonts from a different domain or subdomain | |
location /assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
add_header Access-Control-Allow-Origin *; | |
} |
Create a mountable engine
rails plugin new ENGINE_NAME --dummy-path=spec/dummy --skip-test-unit --mountable
Add these lines to the gemspec file:
s.add_development_dependency 'rspec-rails'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"wordpress": { | |
"domain": "example.com", | |
"sys_user": "exampleuser", | |
"sys_password": "xxxxxxxxxxx", | |
"wp_email": "email@example.com", | |
"wp_user": "exampleuser", | |
"wp_password" "12345", | |
"disk_quota": "1000", | |
"themes": [ "theme-1", "theme-2", "theme-3", "theme-4" ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'tamtam' | |
class CssInliner | |
def self.delivering_email(message) | |
message.subject = "#{message.subject}" | |
#message.to = "ryan@railscasts.com" |