fastlane-plugin-nowsecure 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +69 -0
- data/lib/fastlane/plugin/nowsecure/actions/nowsecure_action.rb +89 -0
- data/lib/fastlane/plugin/nowsecure/version.rb +8 -0
- data/lib/fastlane/plugin/nowsecure.rb +19 -0
- metadata +190 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f810f888ddba9dab34d903684aa775b4f27b531bd42c2b7cbd770d9b628f61af
|
4
|
+
data.tar.gz: 4602a91dd8f3c931d392df7d4fa04c845cc00e054717a10c504a955f6b5e2c5b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9ec7d6efcdd031b872df57a502122605411d06d6e51afcc9fbacc4bc2b7e14e67361185b7af7abe916b0f282d4e93810538b70514dce091e6f0a4e39ce581d19
|
7
|
+
data.tar.gz: 8edb25006903053883859231798d03388acd6b6a78561153fbf5d0bf71aa63ae90564314e9879e5e90132ea5e8e5399a8c8a20d01c926fc145a70926d9448273
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) Warner Media, LLC. All other rights reserved.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# NowSecure `Fastlane` Plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-nowsecure)
|
4
|
+
[](https://github.com/warnermedia/fastlane-plugin-nowsecure/actions/workflows/test.yml)
|
5
|
+
|
6
|
+
## Getting Started
|
7
|
+
|
8
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-nowsecure`, add it to your project by running:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
fastlane add_plugin nowsecure
|
12
|
+
```
|
13
|
+
|
14
|
+
## About nowsecure
|
15
|
+
|
16
|
+
Fastlane plugin for [NowSecure](https://www.nowsecure.com/) platform automation.
|
17
|
+
|
18
|
+
All actions require NowSecure account with associated API token and Group ID.
|
19
|
+
|
20
|
+
### Available actions
|
21
|
+
|
22
|
+
#### Action: `upload_to_nowsecure`
|
23
|
+
|
24
|
+
##### Description: Uploads a mobile binary to NowSecure
|
25
|
+
|
26
|
+
##### Parameters:
|
27
|
+
|
28
|
+
Key | Environment Variable Equivalent | Description | Required?
|
29
|
+
------------- | ------------- | ------------- | -------------
|
30
|
+
`nowsecure_token` | `NOWSECURE_TOKEN` | The API token for your NowSecure account | YES
|
31
|
+
`nowsecure_group_id` | `NOWSECURE_GROUP_ID` | The Group ID for your NowSecure account | YES
|
32
|
+
`nowsecure_app_path` | `NOWSECURE_APP_PATH` | File path of app to upload to NowSecure` | YES
|
33
|
+
|
34
|
+
## Example
|
35
|
+
|
36
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
37
|
+
|
38
|
+
## Run tests for this plugin
|
39
|
+
|
40
|
+
To run both the tests, and code style validation, run
|
41
|
+
|
42
|
+
```
|
43
|
+
bundle exec rake
|
44
|
+
```
|
45
|
+
|
46
|
+
To automatically fix many of the styling issues, use
|
47
|
+
```
|
48
|
+
bundle exec rubocop -a
|
49
|
+
```
|
50
|
+
|
51
|
+
## Issues and Feedback
|
52
|
+
|
53
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
54
|
+
|
55
|
+
## Troubleshooting
|
56
|
+
|
57
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
58
|
+
|
59
|
+
## Using _fastlane_ Plugins
|
60
|
+
|
61
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
62
|
+
|
63
|
+
## About _fastlane_
|
64
|
+
|
65
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
This repository is released under [the MIT license](https://en.wikipedia.org/wiki/MIT_License). View the [local license file](./LICENSE).
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# Copyright (c) Warner Media, LLC. All rights reserved. Licensed under the MIT license.
|
2
|
+
# See the LICENSE file for license information.
|
3
|
+
|
4
|
+
require 'fastlane/action'
|
5
|
+
require 'fastlane_core/configuration/config_item'
|
6
|
+
require 'fastlane_core/ui/ui'
|
7
|
+
|
8
|
+
module Fastlane
|
9
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
|
10
|
+
|
11
|
+
module Actions
|
12
|
+
module SharedValues
|
13
|
+
end
|
14
|
+
|
15
|
+
# NowSecure Upload Application API:
|
16
|
+
# https://support.nowsecure.com/hc/en-us/articles/4422142622733-Applications-REST-API#h_01FYPZHMEZK1GZCYW9BVB7BH8G
|
17
|
+
|
18
|
+
class UploadToNowsecureAction < Action
|
19
|
+
def self.run(params)
|
20
|
+
# NowSecure token
|
21
|
+
nowsecure_token = params[:nowsecure_token]
|
22
|
+
# NowSecure group ID
|
23
|
+
nowsecure_group_id = params[:nowsecure_group_id]
|
24
|
+
# File path of app to upload to NowSecure
|
25
|
+
nowsecure_app_path = params[:nowsecure_app_path]
|
26
|
+
|
27
|
+
UI.success("Uploading app to NowSecure")
|
28
|
+
UI.success("This might take a few minutes. Please don't interrupt.")
|
29
|
+
cmd = "curl --request POST \
|
30
|
+
--url \"https://lab-api.nowsecure.com/build/?group=#{nowsecure_group_id}\" \
|
31
|
+
--header \"Authorization: Bearer #{nowsecure_token}\" \
|
32
|
+
--header \"Content-Type: application/binary\" \
|
33
|
+
--header \"Cache-Control: no-cache\" \
|
34
|
+
--silent --show-error --fail \
|
35
|
+
--output nowsecure_response.json \
|
36
|
+
--data-binary \"@#{nowsecure_app_path}\""
|
37
|
+
`#{cmd}`
|
38
|
+
# Check exit code
|
39
|
+
if $?.exitstatus != 0
|
40
|
+
UI.shell_error!("NowSecure upload failed. Curl exit code #{$?.exitstatus}. See URL for meaning: https://everything.curl.dev/usingcurl/returns#available-exit-codes")
|
41
|
+
end
|
42
|
+
UI.success("Successfully uploaded app to NowSecure")
|
43
|
+
end
|
44
|
+
|
45
|
+
#####################################################
|
46
|
+
# @!group Documentation
|
47
|
+
#####################################################
|
48
|
+
|
49
|
+
def self.description
|
50
|
+
"Fastlane plugin for NowSecure"
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.available_options
|
54
|
+
[
|
55
|
+
FastlaneCore::ConfigItem.new(key: :nowsecure_token,
|
56
|
+
env_name: "NOWSECURE_TOKEN",
|
57
|
+
description: "NowSecure token",
|
58
|
+
optional: false,
|
59
|
+
verify_block: proc do |value|
|
60
|
+
UI.user_error!("NowSecure token environment variable `NOWSECURE_TOKEN` is empty or not set") unless value && !value.empty?
|
61
|
+
end),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :nowsecure_group_id,
|
63
|
+
env_name: "NOWSECURE_GROUP_ID",
|
64
|
+
description: "NowSecure group ID",
|
65
|
+
optional: false,
|
66
|
+
verify_block: proc do |value|
|
67
|
+
UI.user_error!("NowSecure Group ID environment variable `NOWSECURE_GROUP_ID` is empty or not set") unless value && !value.empty?
|
68
|
+
end),
|
69
|
+
FastlaneCore::ConfigItem.new(key: :nowsecure_app_path,
|
70
|
+
env_name: "NOWSECURE_APP_PATH",
|
71
|
+
description: "File path of app to upload to NowSecure",
|
72
|
+
optional: false,
|
73
|
+
verify_block: proc do |value|
|
74
|
+
UI.user_error!("Could not find a file at '#{value}'") unless File.exist?(value)
|
75
|
+
end)
|
76
|
+
]
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.authors
|
80
|
+
["Andy Obusek | GitHub: @obuseme | Twitter: @obusek",
|
81
|
+
"Onyx Mueller | GitHub: @onyxmueller | Twitter: @onyx"]
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.is_supported?(platform)
|
85
|
+
true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Copyright (c) Warner Media, LLC. All rights reserved. Licensed under the MIT license.
|
2
|
+
# See the LICENSE file for license information.
|
3
|
+
|
4
|
+
require 'fastlane/plugin/nowsecure/version'
|
5
|
+
|
6
|
+
module Fastlane
|
7
|
+
module Nowsecure
|
8
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
9
|
+
def self.all_classes
|
10
|
+
Dir[File.expand_path('**/{actions}/*.rb', File.dirname(__FILE__))]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# By default we want to import all available actions and helpers
|
16
|
+
# A plugin can contain any number of actions and plugins
|
17
|
+
Fastlane::Nowsecure.all_classes.each do |current|
|
18
|
+
require current
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-nowsecure
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andy Obusek
|
8
|
+
- Onyx Mueller
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: fastlane
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.212.2
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 2.212.2
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rspec_junit_formatter
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rubocop
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 1.12.1
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.12.1
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rubocop-performance
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-require_tools
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: simplecov
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
description:
|
155
|
+
email:
|
156
|
+
- andrew.obusek@warnerbros.com
|
157
|
+
- onyx.mueller@warnermedia.com
|
158
|
+
executables: []
|
159
|
+
extensions: []
|
160
|
+
extra_rdoc_files: []
|
161
|
+
files:
|
162
|
+
- LICENSE
|
163
|
+
- README.md
|
164
|
+
- lib/fastlane/plugin/nowsecure.rb
|
165
|
+
- lib/fastlane/plugin/nowsecure/actions/nowsecure_action.rb
|
166
|
+
- lib/fastlane/plugin/nowsecure/version.rb
|
167
|
+
homepage:
|
168
|
+
licenses:
|
169
|
+
- MIT
|
170
|
+
metadata: {}
|
171
|
+
post_install_message:
|
172
|
+
rdoc_options: []
|
173
|
+
require_paths:
|
174
|
+
- lib
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '2.6'
|
180
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
requirements: []
|
186
|
+
rubygems_version: 3.1.6
|
187
|
+
signing_key:
|
188
|
+
specification_version: 4
|
189
|
+
summary: Fastlane plugin for NowSecure
|
190
|
+
test_files: []
|