mock_code_manager 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +51 -8
- data/lib/mock_code_manager/version.rb +1 -1
- data/mock_code_manager.gemspec +6 -6
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9764397b0cf98fff13c86adecef1e408868185ef6ffa05271b80133880b908dd
|
4
|
+
data.tar.gz: 0fffff851eab0c0012a178edb7d7a6ceaef63f1bf92077312578c6676dfa8bd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c51fc10a021c1aec6b9b97af39bf55c0085d7516058e7229d82091c3c3d846c605c26d4f6064b8adcc69cd3df28236f8cbebc2e1cc40d2967a6bdefa083e20df
|
7
|
+
data.tar.gz: b856cc59fba06be3809425a66654e456e8b26835849665a9fadcb43fba88051310973042eaa2b96ff0410557e9938dd74cee8d7af327372cba9cc4d4d1b25f96
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# MockCodeManager
|
2
2
|
|
3
|
-
|
3
|
+
This is a limited mock version of the [Puppet Code Manager REST API](https://docs.puppet.com/pe/latest/code_mgr_scripts.html).
|
4
4
|
|
5
|
-
|
5
|
+
It exists to allow Integration testing of software consuming this service without the need to stand-up a complete working Puppet Enterprise environment
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -20,16 +20,59 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install mock_code_manager
|
22
22
|
|
23
|
+
## Requirements
|
24
|
+
|
25
|
+
* Ruby 2.3+ (use [RVM](https://rvm.io/))
|
26
|
+
* openssl
|
27
|
+
* Access to `/tmp/mock_code_manager_ssl` for credential storage
|
28
|
+
* Hostname as reported by `hostname -f` **must** match the fqdn the service will be accessed from
|
29
|
+
* Port 8170 my be avaiable and reachable by the outside world
|
30
|
+
|
23
31
|
## Usage
|
24
32
|
|
25
|
-
|
33
|
+
### Simple
|
26
34
|
|
27
|
-
|
35
|
+
To generate all required SSL credentials and start a server on port 8170, run the command:
|
28
36
|
|
29
|
-
|
37
|
+
```shell
|
38
|
+
mock_code_manager
|
39
|
+
```
|
30
40
|
|
31
|
-
|
41
|
+
Note that this service will terminate when your login shell exits. To prevent this, use `screen`, `nohup`, etc.
|
32
42
|
|
33
|
-
|
43
|
+
### Ruby
|
44
|
+
|
45
|
+
You can use the library as part of your ruby projects if you like. Something like:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Thread.start { MockCodeManager::WEBrick.run! }
|
49
|
+
```
|
50
|
+
|
51
|
+
In your `spec_helper.rb` along with a delay/test while the credentials are generated should be enough to get you started.
|
52
|
+
|
53
|
+
## API completeness
|
34
54
|
|
35
|
-
|
55
|
+
`/code-manager/v1/deploys`
|
56
|
+
* Authentication check
|
57
|
+
* Deploy all environments (`deploy-all`)
|
58
|
+
* Deploy selected environments (`environments`)
|
59
|
+
|
60
|
+
## Authentication
|
61
|
+
You must pass authentication tokens using the `X-Authentication` HTTP header.
|
62
|
+
|
63
|
+
The service will return an appropriate response based on the value or absence of this header:
|
64
|
+
|
65
|
+
### `PUPPET_DEPLOY_OK`
|
66
|
+
Proceed to service request
|
67
|
+
|
68
|
+
### Absent
|
69
|
+
`puppetlabs.rbac/user-unauthenticated`
|
70
|
+
|
71
|
+
|
72
|
+
### `PUPPET_DEPLOY_FAIL` (or any other value)
|
73
|
+
`puppetlabs.rbac/token-revoked`
|
74
|
+
|
75
|
+
Note that the above responses are **always** expressed as JSON and always with status `200`.
|
76
|
+
|
77
|
+
## Contributing
|
78
|
+
PRs accepted :)
|
data/mock_code_manager.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler", "~>
|
23
|
-
spec.add_development_dependency "rake", "~>
|
24
|
-
spec.add_development_dependency "rspec", "~> 3.
|
22
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
23
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.8"
|
25
25
|
|
26
|
-
spec.add_dependency "sinatra", "
|
27
|
-
spec.add_dependency "webrick", "1.
|
28
|
-
spec.add_dependency "rack", "
|
26
|
+
spec.add_dependency "sinatra", "2.0.5"
|
27
|
+
spec.add_dependency "webrick", "1.4.2"
|
28
|
+
spec.add_dependency "rack", "2.0.7"
|
29
29
|
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_code_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.8'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.8'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: sinatra
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.0.5
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.0.5
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webrick
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.4.2
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.4.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 2.0.7
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 2.0.7
|
97
97
|
description:
|
98
98
|
email:
|
99
99
|
- geoff@geoffwilliams.me.uk
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.7.6
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: A mock version of Puppet Code Manager
|