Skip to content

Commit

Permalink
Rails credentials in new sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Oct 28, 2024
1 parent a91bfbc commit d383d68
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 503 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
.DS_Store

/.byebug_history
.byebug_history
/.bundle
/.yardoc
/doc
/Gemfile.lock
Gemfile.lock
/coverage
*.gem
/.release

.idea/

gemfiles/*.gemfile.lock
sample-app/Gemfile.lock
sample-app/log

test/dummy/db/migrate
test/dummy/log/

sample_app/Gemfile.lock
spec/dummy/db/test.db-shm
spec/dummy/db/test.db-wal
spec/dummy/db/test.db
spec/dummy/db/schema.rb
spec/dummy/log/
spec/dummy/tmp/
spec/dummy/tmp/
8 changes: 3 additions & 5 deletions lib/aws/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ def self.log_to_rails_logger
# Configures the AWS SDK with credentials from Rails encrypted credentials.
def self.use_rails_encrypted_credentials
# limit the config keys we merge to credentials only
aws_credential_keys = %i[access_key_id secret_access_key session_token]

Aws.config.merge!(
::Rails.application.credentials[:aws].to_h.slice(*aws_credential_keys)
)
aws_credential_keys = %i[access_key_id secret_access_key session_token account_id]
creds = ::Rails.application.credentials[:aws].slice(*aws_credential_keys)
Aws.config.merge!(creds)
end

# Adds ActiveSupport Notifications instrumentation to AWS SDK
Expand Down
6 changes: 4 additions & 2 deletions sample-app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ source "https://rubygems.org"

# Our gems
gem 'aws-sdk-rails', path: '../'
gem 'aws-sessionstore-dynamodb', path: '../../aws-sessionstore-dynamodb-ruby'
gem 'aws-sessionstore-dynamodb' #, path: '../../aws-sessionstore-dynamodb-ruby'

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt"
gem 'bcrypt'

gem 'byebug', platforms: :ruby

### Created by generator

Expand Down
334 changes: 0 additions & 334 deletions sample-app/Gemfile.lock

This file was deleted.

Loading

0 comments on commit d383d68

Please sign in to comment.