Skip to content

Commit

Permalink
Improved configuration parameter validation (#36)
Browse files Browse the repository at this point in the history
* Added simple check, not starting with http:// or https://

* Update publish-rock.yml

* Update build.yml

* Update publish-rock.yml
  • Loading branch information
DanielRailean authored Feb 20, 2024
1 parent db757b7 commit 0250a5a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
args: kong spec
unit-tests:
needs: linting
needs: linting
name: Running unit tests.
runs-on: ubuntu-latest
steps:
Expand All @@ -40,4 +40,13 @@ jobs:
- run: luarocks make

- name: luarocks pack
run: luarocks pack $(find . -maxdepth 1 -name "kong-aws-request-signing-*.rockspec" -print | sed 's/.\///g' | sed 's/.rockspec//g' | sed 's/signing-/signing /g')
run: luarocks pack $(find . -maxdepth 1 -name "kong-aws-request-signing-*.rockspec" -print | sed 's/.\///g' | sed 's/.rockspec//g' | sed 's/signing-/signing /g')

- name: get version
id: version
run: echo "version=$(luarocks show aws-request-signing --mversion)" >> "$GITHUB_OUTPUT"

- name: Echo version
env:
VERSION: ${{ steps.version.outputs.version }}
run: echo $VERSION
19 changes: 15 additions & 4 deletions .github/workflows/publish-rock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "*.rockspec"
workflow_dispatch:


jobs:
build_rock:
Expand All @@ -19,14 +19,18 @@ jobs:

- name: luarocks pack
run: luarocks pack $(find . -maxdepth 1 -name "kong-aws-request-signing-*.rockspec" -print | sed 's/.\///g' | sed 's/.rockspec//g' | sed 's/signing-/signing /g')


- name: get version
id: version
run: echo "version=$(luarocks show aws-request-signing --mversion)" >> "$GITHUB_OUTPUT"

- name: Get token to commit
id: get_token
uses: peter-murray/[email protected]
with:
application_id: ${{ secrets.APP_GITHUB_100101_ID }} #Org app id
application_private_key: ${{ secrets.APP_GITHUB_100101_PRIVATE_KEY }} #Org app secret

- name: Commit the rock
env:
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
Expand All @@ -42,4 +46,11 @@ jobs:
--field content="$CONTENT" \
--field encoding="base64" \
--field branch="$DESTINATION_BRANCH" \
--field sha="$SHA"
--field sha="$SHA"
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.version.outputs.version }}
name: Release ${{ steps.version.outputs.version }}
token: ${{ steps.get_token.outputs.token }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local plugin_name = "aws-request-signing"
local package_name = "kong-" .. plugin_name
local package_version = "1.0.3"
local package_version = "1.0.4"
local rockspec_revision = "3"

local github_account_name = "LEGO"
Expand Down
2 changes: 1 addition & 1 deletion kong/plugins/aws-request-signing/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ function AWSLambdaSTS:access(conf)
end

AWSLambdaSTS.PRIORITY = 110
AWSLambdaSTS.VERSION = "1.0.3"
AWSLambdaSTS.VERSION = "1.0.4"

return AWSLambdaSTS
3 changes: 2 additions & 1 deletion kong/plugins/aws-request-signing/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ return {
required = true,
} },
{ override_target_host = {
type = "string"
type = "string",
not_match = "^https?://"
} },
{ override_target_port = {
type = "number"
Expand Down

0 comments on commit 0250a5a

Please sign in to comment.