tyage / slack-patron

Log and view all Slack messages.
MIT License
169 stars 41 forks source link

Fix a viewer error that occurs when AWS is not used. #133

Closed sutatoruta closed 1 year ago

sutatoruta commented 2 years ago

Even if AWS credentials config values are nil, $config.has_key? :aws returns true. It might not be working as expected: https://github.com/tyage/slack-patron/blob/c86c4777b9d2642c8171f19d07214aeb6d45b995/viewer/viewer.rb#L13-L22

Since $singer is not nil, presigned_url is called without AWS credentials set and throws Aws::Sigv4::Errors::MissingCredentialsError: https://github.com/tyage/slack-patron/blob/c86c4777b9d2642c8171f19d07214aeb6d45b995/viewer/viewer.rb#L29-L56

I fixed this problem by correcting $config.has_key? :aws to $config[:aws]&.values.all?.

tyage commented 1 year ago

thank you! looks fine!