versacommerce-theme_api_client 1.0.1 → 1.0.2

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: 4fcf2656faa757b046931d4a22ead1d4cfa15758320b1c32504f897565a5eaba
4
- data.tar.gz: 4f9bcef22485ca0be490100dee1153b33f916b7f6b840aae47196458a39c141b
3
+ metadata.gz: 2475dfd16c9b90dd2a5d6d76a5611d39b188131152560698dbf7e215b0cac5e6
4
+ data.tar.gz: fe2ece15355542927dc8c3584c465b4a3c474e3a6d7e29abe1076f90ead03276
5
5
  SHA512:
6
- metadata.gz: 6805af2804b62be8808a3119b1bc280b1264a6f711a333b26b86e7bce7198201773fd22b0c929346c8daa4f021b578d44131048a3805916ed305c47ea210980d
7
- data.tar.gz: 2b3a4a26c23598b963deb0a7fe9941e9ee45df6e8fdd99bec939f7e221c49bdaac5043505ccc3b6406f4828459afa92c70c0b0b5b0e6b0b254664f1d79f4a2df
6
+ metadata.gz: 95bf32338399a00967aaa6e3454807e3563d5eaecc98761f14c0e80ad400c8c92252af7d8ab819a3215db2323b691898ff60fe7dec20f6678853f9c455e9cbde
7
+ data.tar.gz: 372c77b36a475243e133f48c0472b8c2acde9a752feee9f92ca923b641f00f8fa7011085d69434c6231d1896b3ddc2ae301e2715cf32d140886dda3bc441fd58
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.2] - 2025-10-30
9
+
10
+ ### Added
11
+ - SSL verification configuration option (`ssl_verify` attribute)
12
+ - Support for custom base URL configuration
13
+ - Comprehensive configuration documentation in README
14
+
15
+ ### Changed
16
+ - Default SSL verification is enabled (secure by default)
17
+ - Fetcher now respects `ssl_verify` setting when making HTTP requests
18
+
19
+ ## [1.0.1] - Previous Release
20
+
21
+ ### Changed
22
+ - Updated to Ruby 3.1+
23
+ - Loosened gem dependencies
data/README.md CHANGED
@@ -41,6 +41,42 @@ client = Versacommerce::ThemeAPIClient.new(authorization: authorization)
41
41
 
42
42
  The client object is tied to a single theme, depending on the authorization. You can get an authorization from your shop's admin section.
43
43
 
44
+ ### Configuration Options
45
+
46
+ The client accepts the following configuration options:
47
+
48
+ ```ruby
49
+ client = Versacommerce::ThemeAPIClient.new(
50
+ authorization: 'YOUR_AUTHORIZATION', # Required: API authorization token
51
+ base_url: 'https://theme-api.versacommerce.de', # Optional: Custom API endpoint
52
+ ssl_verify: true # Optional: Enable/disable SSL certificate verification (default: true)
53
+ )
54
+ ```
55
+
56
+ #### SSL Verification
57
+
58
+ By default, SSL certificate verification is enabled. You can disable it for development/testing environments with self-signed certificates:
59
+
60
+ ```ruby
61
+ client = Versacommerce::ThemeAPIClient.new(
62
+ authorization: 'YOUR_AUTHORIZATION',
63
+ ssl_verify: false # Disable SSL verification (not recommended for production)
64
+ )
65
+ ```
66
+
67
+ **Warning:** Disabling SSL verification is not recommended for production environments.
68
+
69
+ #### Custom Base URL
70
+
71
+ If you need to connect to a different API endpoint (e.g., staging environment):
72
+
73
+ ```ruby
74
+ client = Versacommerce::ThemeAPIClient.new(
75
+ authorization: 'YOUR_AUTHORIZATION',
76
+ base_url: 'https://staging-theme-api.example.com'
77
+ )
78
+ ```
79
+
44
80
  ### Working with Directories
45
81
 
46
82
  #### Finding Directories
@@ -84,7 +84,17 @@ module Versacommerce
84
84
  end
85
85
 
86
86
  def with_headers
87
- HTTP.headers(accept: 'application/json', 'Theme-Authorization' => authorization)
87
+ http_client = HTTP.headers(accept: 'application/json', 'Theme-Authorization' => authorization)
88
+
89
+ # Apply SSL verification setting if explicitly disabled
90
+ unless client.ssl_verify
91
+ require 'openssl'
92
+ ssl_context = OpenSSL::SSL::SSLContext.new
93
+ ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
94
+ http_client = http_client.use(ssl_context: ssl_context)
95
+ end
96
+
97
+ http_client
88
98
  end
89
99
  end
90
100
  end
@@ -1,5 +1,5 @@
1
1
  module Versacommerce
2
2
  class ThemeAPIClient
3
- VERSION = Gem::Version.new('1.0.1')
3
+ VERSION = Gem::Version.new('1.0.2')
4
4
  end
5
5
  end
@@ -7,10 +7,12 @@ require 'versacommerce/theme_api_client/version'
7
7
 
8
8
  module Versacommerce
9
9
  class ThemeAPIClient
10
- attr_accessor :authorization
10
+ attr_accessor :authorization, :ssl_verify
11
11
  attr_writer :base_url, :fetcher
12
12
 
13
13
  def initialize(attributes = {})
14
+ @ssl_verify = true # Default to true (secure by default)
15
+
14
16
  attributes.each do |key, value|
15
17
  public_send("#{key}=", value)
16
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versacommerce-theme_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - VersaCommerce GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-29 00:00:00.000000000 Z
11
+ date: 2025-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -128,6 +128,7 @@ extra_rdoc_files: []
128
128
  files:
129
129
  - ".gitignore"
130
130
  - ".ruby-version"
131
+ - CHANGELOG.md
131
132
  - CLAUDE.md
132
133
  - Gemfile
133
134
  - LICENSE.txt