Skip to content

Commit

Permalink
[MASTER] feat: add support for configuring token and private key via …
Browse files Browse the repository at this point in the history
…io.99x.imageshop.cfg

Updated the application to allow the ImageShop token and private key to be set using the configuration file (io.99x.imageshop.cfg) through the variables `imageshopToken` and `imageshopPrivateKey`. This provides a more secure and centralized way to manage credentials.
  • Loading branch information
Káio Simonassi committed Nov 25, 2024
1 parent 496becf commit 6f06946
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ cd imageshop-xp
- **Language** (optional, default language for image searches)

These inputs ensure the proper configuration and functionality of the ImageShop integration in your site.
3. **Alternative Token and Private Key Configuration**:
The **Token** and **Private Key** required for HTTP requests to the ImageShop endpoint can also be provided through the configuration file `io.99x.imageshop.cfg`. Use the following variables in the file:

- `imageshopToken`: Specify the ImageShop token.
- `imageshopPrivateKey`: Specify the ImageShop private key.

This approach offers a centralized and secure way to manage these credentials.



Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gradle Project settings
projectName = imageshop
version = 1.0.1
version = 1.0.2

# XP App values
appDisplayName = ImageShop
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/lib/modules/iimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function getTemporaryToken (appConfig) {
url: 'https://webservices.imageshop.no/V4.asmx/GetTemporaryToken',
method: 'GET',
queryParams: {
privateKey: appConfig.iimage_private_key,
token: appConfig.iimage_token
privateKey: app.config.imageshopPrivateKey || appConfig.iimage_private_key,
token: app.config.imageshopToken || appConfig.iimage_token
}
})

Expand Down

0 comments on commit 6f06946

Please sign in to comment.