
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Memflash is a gem which enables storing really long values in the Rails FlashHash
without writing them to the session. Instead, it transparently uses Rails.cache
, thus
enabling the flash in your actions to contain large values, and still fit in a cookie-based
session store.
Memflash is completely transparent -- requiring the gem automatically enhances FlashHash with caching-enabled reads and writes.
By default, any message that is over 300 characters long, will be saved in Rails.cache, and a pointer to it stored in the flash. You can change this anywhere in your app by:
Memflash.threshold = #{length-at-which-writing-to-the-cache-is-trigerred}
Memflash ties into the []
and []=
methods of Rails's FlashHash. On writes, if the value
being written has a length over Memflash.threshold, Memflash generates a pseudo-random
key for it, writes the pseudo-random key and original value to Rails.cache
, and stores
the original key and pseudo-random key in the flash. Conceptually, when you write
flash[:error] = "some message"
, this is equivalent to:
if "some message".length >= Memflash.threshold
# generate a psedudo-random key, memflash_key
# write memflash_key, "some message" to Rails.cache
# write :error, memflash_key to the flash
else
# write :error, "some message" to the flash, as usual
end
On the flip side, reading from the flash, flash[:error]
is conceptually equivalent to:
if the value for :error stored in the flash is a memflash key
# read the original (large) value from Rails.cache
# return the original (large) value
else
# return the value stored in the flash, as usual
end
A new version is published to RubyGems.org every time a change to version.rb
is pushed to the main
branch.
In short, follow these steps:
version.rb
,Gemfile.lock
files,main
, andTo create a pre-release from a non-main branch:
version.rb
to something like 1.2.0.pre.1
or 2.0.0.beta.2
,Authored by Vladimir Andrijevik
Copyright 2013 Zendesk
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Unknown package
We found that memflash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.