appydave-tools 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93dd9f15e347dfb0b0cb8bc5897e936317cbc8af13af40d3b51fd912d9c7cb7b
4
- data.tar.gz: a7b21ab65386f0291c584263f0247513b4ad35513246e68bf873330e70221836
3
+ metadata.gz: eb7c81970bea29e5f86aaebacc85292975b6924b2adb018fe30d1cd7c1448cfc
4
+ data.tar.gz: 703de8b5395349f6150e624be408b7389e2ec5cbef2f95a229ddbdd1a904c210
5
5
  SHA512:
6
- metadata.gz: 54f08c9a7b2d340fbe0a6600b239a0fa02bb3e7d869923bcf5ddb8e29ed911f3aac066ae358f078c07f9f75d9025464b10fd355bf245125c7ab6ba4e279d0b02
7
- data.tar.gz: bf5358fd24eb33c6533ba6593c3195d45285d6f5ad5e926d4db2a34ce3bb0b1fc7557cca4d4b5978b7c5171ef68c3ef20589ca2369e23a9a4479ccacb7ab7e61
6
+ metadata.gz: 4c714685a4a6611bf7fada4e6116de93a9054c5bd305c3733936501e3658d3e3d4310daf787da2d8a7967ec4b172926e6a7ae86b2695d284262989a8ead7850b
7
+ data.tar.gz: acb79cb193a502a25847e8f31ba8a8266905bb87d4ec60f07ca2706534775b9f10387a23abf5692c3b0884542829067cd02f26baeac13bf2ff844b8169234567
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # [0.22.0](https://github.com/appydave/appydave-tools/compare/v0.21.2...v0.22.0) (2025-11-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * fix remaining rubocop string literal issue ([a28b9be](https://github.com/appydave/appydave-tools/commit/a28b9bedc31777bf382ebdc54b0abd4e27b7609a))
7
+ * fix rubocop issues in S3 scanner implementation ([20e9d48](https://github.com/appydave/appydave-tools/commit/20e9d481843aa4ab622a3ce6e56ff1183e3bad27))
8
+ * implement S3 scanning to query AWS for actual file data ([f452f95](https://github.com/appydave/appydave-tools/commit/f452f9587ed94f25f100ff36682f9b9c4312b975))
9
+
1
10
  ## [0.21.2](https://github.com/appydave/appydave-tools/compare/v0.21.1...v0.21.2) (2025-11-17)
2
11
 
3
12
 
@@ -32,6 +32,10 @@ module Appydave
32
32
  get('download-image-folder') || download_folder
33
33
  end
34
34
 
35
+ def current_user
36
+ get('current_user')
37
+ end
38
+
35
39
  def print
36
40
  log.subheading 'Settings Configuration'
37
41
 
@@ -50,9 +50,31 @@ module Appydave
50
50
  Appydave::Tools::Configuration::Config.brands.get_brand(brand)
51
51
  end
52
52
 
53
+ # Determine which AWS profile to use based on current user
54
+ # Priority: current user's default_aws_profile > brand's aws.profile
55
+ def determine_aws_profile(brand_info)
56
+ # Get current user from settings (if available)
57
+ begin
58
+ current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
59
+
60
+ if current_user_key
61
+ # Look up current user's default AWS profile
62
+ users = Appydave::Tools::Configuration::Config.brands.data['users']
63
+ user_info = users[current_user_key]
64
+
65
+ return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
66
+ end
67
+ rescue Appydave::Tools::Error
68
+ # Config not available (e.g., in test environment) - fall through to brand profile
69
+ end
70
+
71
+ # Fallback to brand's AWS profile
72
+ brand_info.aws.profile
73
+ end
74
+
53
75
  def create_s3_client(brand_info)
54
- profile_name = brand_info.aws.profile
55
- raise "AWS profile not configured for brand '#{brand}'" if profile_name.nil? || profile_name.empty?
76
+ profile_name = determine_aws_profile(brand_info)
77
+ raise "AWS profile not configured for current user or brand '#{brand}'" if profile_name.nil? || profile_name.empty?
56
78
 
57
79
  credentials = Aws::SharedCredentials.new(profile_name: profile_name)
58
80
 
@@ -84,9 +84,31 @@ module Appydave
84
84
  Appydave::Tools::Configuration::Config.brands.get_brand(brand)
85
85
  end
86
86
 
87
+ # Determine which AWS profile to use based on current user
88
+ # Priority: current user's default_aws_profile > brand's aws.profile
89
+ def determine_aws_profile(brand_info)
90
+ # Get current user from settings (if available)
91
+ begin
92
+ current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
93
+
94
+ if current_user_key
95
+ # Look up current user's default AWS profile
96
+ users = Appydave::Tools::Configuration::Config.brands.data['users']
97
+ user_info = users[current_user_key]
98
+
99
+ return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
100
+ end
101
+ rescue Appydave::Tools::Error
102
+ # Config not available (e.g., in test environment) - fall through to brand profile
103
+ end
104
+
105
+ # Fallback to brand's AWS profile
106
+ brand_info.aws.profile
107
+ end
108
+
87
109
  def create_s3_client(brand_info)
88
- profile_name = brand_info.aws.profile
89
- raise "AWS profile not configured for brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
110
+ profile_name = determine_aws_profile(brand_info)
111
+ raise "AWS profile not configured for current user or brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
90
112
 
91
113
  credentials = Aws::SharedCredentials.new(profile_name: profile_name)
92
114
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.22.0'
5
+ VERSION = '0.23.0'
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydave-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys