diff --git a/README.md b/README.md index 35a4705..e1e1c9f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/gradle.properties b/gradle.properties index e16fd2a..ff092bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ # Gradle Project settings projectName = imageshop -version = 1.0.1 +version = 1.0.2 # XP App values appDisplayName = ImageShop diff --git a/src/main/resources/lib/modules/iimage.js b/src/main/resources/lib/modules/iimage.js index b047f5f..5c4f106 100644 --- a/src/main/resources/lib/modules/iimage.js +++ b/src/main/resources/lib/modules/iimage.js @@ -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 } })