Skip to content

Commit

Permalink
Merge pull request #30 from lucywyman/GH-29
Browse files Browse the repository at this point in the history
(GH-29) Use regex to validate token file input
  • Loading branch information
lucywyman committed Jun 24, 2021
2 parents b9efaaa + 11fe3ac commit 0ae033e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/spec.yaml
@@ -0,0 +1,23 @@
name: Spec tests

on:
pull_request:
types: [opened, reopened, edited, synchronize]

jobs:

spec:
name: Spec test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Update gems
run: bundle update
- name: Run tests
run: bundle exec rspec
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -71,6 +71,14 @@ issues](https://github.com/puppetlabs/orchestrator_api-ruby/issues).
If you are interested in contributing to this project, please see the
[Contribution Guidelines](CONTRIBUTING.md)

## Releasing

Use the
https://cinext-jenkinsmaster-sre-prod-1.delivery.puppetlabs.net/job/qe_orchestrator-client-ruby_init-multijob_master/
job to release. This pipeline will update the [version file](lib/orchestrator_client/version.rb),
create the tag you specify, and push release [to
rubygems](https://rubygems.org/gems/orchestrator_client).

## License

See LICENSE.
3 changes: 2 additions & 1 deletion lib/orchestrator_client/config.rb
Expand Up @@ -98,7 +98,8 @@ def load_token
else
validate_file('token-file', config['token-file'])
token = File.open(config['token-file']) { |f| f.read.strip }
if token != URI.escape(token)
# If the token file contains illegal characters
if token =~ URI::UNSAFE
raise OrchestratorClient::ConfigError.new("token-file '#{config['token-file']}' contains illegal characters")
end
@config['token'] = token
Expand Down

0 comments on commit 0ae033e

Please sign in to comment.