-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
harmonize compliance profiles view with supermarket views #1654
Conversation
77e21e2
to
29f46c0
Compare
29f46c0
to
efd9153
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a question I'd love an answer to, and some suggestions for future. Nothing blocking except the failing travis test.
@@ -57,7 +57,14 @@ def login(server) # rubocop:disable Metrics/AbcSize | |||
puts '', msg | |||
end | |||
|
|||
desc "login_automate SERVER --user='USER' --ent='ENT' --dctoken or --usertoken='TOKEN'", 'Log in to an Automate SERVER' | |||
desc "login_automate SERVER --insecure --user='USER' --ent='ENT' --usertoken='TOKEN'", 'Log in to an Automate SERVER' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to see this be inspec compliance login --automate
in the future than require a completely separate command. It feels weird to me from a CLI UX perspective. Not a blocker, obviously :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
{ org: owner, name: name } | ||
end | ||
end.flatten | ||
mapped_profiles = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use another Rubyism I love... #each_with_object
:
mapped_profiles = profiles.values.each_with_object([]) do |org, memo|
memo << org.values
end
Again, not a blocker, just passing along something I always try and address when I see an empty object being created just to populate it with enumeration.
lib/bundles/inspec-compliance/cli.rb
Outdated
@@ -260,6 +269,16 @@ def logout | |||
|
|||
private | |||
|
|||
# returns a parsed url for `admin/profile` or `compliance://admin/profile` | |||
def sanitize_profile_name(profile) | |||
if profile.is_a?(String) && URI(profile).scheme == 'compliance' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would profile
not be a String
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point :-)
@chris-rock Can we fix the failing functional test before merge? |
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
efd9153
to
a0da23f
Compare
This PR:
inspec compliance profiles
list to our supermarket viewcompliance://admin/profile
andadmin/profile
as input