Skip to content

Commit e2afb99

Browse files
committed
Removed file support. Updated readme.
1 parent 2a86113 commit e2afb99

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# Secrets::Manager
2-
3-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/secrets/manager`. To experiment with that code, run `bin/console` for an interactive prompt.
4-
5-
TODO: Delete this and the text above, and describe your gem
1+
# SecretsManager.rb
62

73
## Installation
84

@@ -22,7 +18,21 @@ Or install it yourself as:
2218

2319
## Usage
2420

25-
TODO: Write usage instructions here
21+
To use this gem, you must have an AWS account and permissions to setup secret values using [Secrets Manager](https://aws.amazon.com/secrets-manager/)
22+
23+
This gem makes assumptions and has requirements about how you should be storing your secrets.
24+
25+
### Path Name
26+
This gem uses the concept of env specific secrets within the same account. While separate AWS accounts can be used to maintain separation, it can be desirable to use a single account.
27+
28+
The path format is as follows: `{{secret_env}}/{{secret_path}}`. When using this gem you would leave the `secret_env` out of your request.
29+
30+
For example, to access the secret `twlio-key`, `$secrets.fetch('twilio-key')`. This would be stored in AWS SM as `dev/twilio-key`.
31+
32+
### Payload
33+
This gem expects your secret value to be a JSON object. The only required key is `value`. The following keys are optional:
34+
* `ttl` - Time to live in seconds. Describes how long the secret should live in in-memory cache.
35+
* `encoding` - Currently, only `base64` is supported as a value. If your `value` is base64 encoded, this will result in a returned secret that is base64 decoded.
2636

2737
## Development
2838

lib/secrets-manager.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ def parse_value(data)
8989
end
9090
end
9191

92-
if data[:type].present?
93-
case data[:type]
94-
when "file"
95-
value = StringIO.new(Base64.strict_decode64(data[:value]))
96-
end
97-
end
98-
9992
return value
10093
end
10194
end

0 commit comments

Comments
 (0)