versacommerce-theme_api_client 1.0.1 → 1.0.3
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 +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +29 -0
- data/README.md +36 -0
- data/lib/versacommerce/theme_api_client/fetcher.rb +14 -1
- data/lib/versacommerce/theme_api_client/version.rb +1 -1
- data/lib/versacommerce/theme_api_client.rb +3 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b55076c626acc68c3a8842ef61e738ba44a6abe7e89e2dfcfc3916998dac7c24
|
|
4
|
+
data.tar.gz: 2b8bb0bd1c1920663c6f978024cb933da8ec5d9c9d3b7d584fdb123406969a7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d1640c6dfedcbe81522344c4bf27cff199c17721323bb1a3e59f4c04739b00a01802deb76fd98c090a85e379f8c42968d8acb733f0f8dfb52a2f98dd36e83fd
|
|
7
|
+
data.tar.gz: a0f60e0ec95a0edb1b717717d4830e50dfbb86cda612811a136a8d469f231cb0c6f0f67e1cc358c87403b7c5a2d284b4e84c22c016df9311ad6278bc20613696
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.3.6
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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.3] - 2025-10-30
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- SSL context configuration now correctly uses HTTP gem 5.x API
|
|
12
|
+
- Fixed `with_ssl_context` implementation to work with HTTP::Options and HTTP::Client
|
|
13
|
+
|
|
14
|
+
## [1.0.2] - 2025-10-30
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- SSL verification configuration option (`ssl_verify` attribute)
|
|
18
|
+
- Support for custom base URL configuration
|
|
19
|
+
- Comprehensive configuration documentation in README
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Default SSL verification is enabled (secure by default)
|
|
23
|
+
- Fetcher now respects `ssl_verify` setting when making HTTP requests
|
|
24
|
+
|
|
25
|
+
## [1.0.1] - Previous Release
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Updated to Ruby 3.1+
|
|
29
|
+
- 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,20 @@ 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
|
+
|
|
95
|
+
# Create new options with SSL context and rebuild HTTP client
|
|
96
|
+
new_options = http_client.default_options.with_ssl_context(ssl_context)
|
|
97
|
+
http_client = HTTP::Client.new(new_options)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
http_client
|
|
88
101
|
end
|
|
89
102
|
end
|
|
90
103
|
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.
|
|
4
|
+
version: 1.0.3
|
|
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-
|
|
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
|
|
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
166
167
|
- !ruby/object:Gem::Version
|
|
167
168
|
version: '0'
|
|
168
169
|
requirements: []
|
|
169
|
-
rubygems_version: 3.
|
|
170
|
+
rubygems_version: 3.5.22
|
|
170
171
|
signing_key:
|
|
171
172
|
specification_version: 4
|
|
172
173
|
summary: API Client for the VersaCommercer Theme API.
|