Skip to content
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

Set default elevation type for credentials #172

Merged
merged 2 commits into from
May 12, 2015
Merged

Set default elevation type for credentials #172

merged 2 commits into from
May 12, 2015

Conversation

csong-r7
Copy link
Contributor

This is a simple change that prevents the issue where if the credentials are set without explicitly setting the elevation type (cred.permission_elevation_type = nil), the API responds with the following error:

/home/csong/.rvm/gems/ruby-2.2.0@vuln-tools/gems/nexpose-1.0.0/lib/nexpose/ajax.rb:166:in `request': NexposeAPI: POST request to /api/2.1/site_configurations/ failed. response body: {"errors":["Permission Elevation User must be specified for this action."]} (Nexpose::APIError)
from /home/csong/.rvm/gems/ruby-2.2.0@vuln-tools/gems/nexpose-1.0.0/lib/nexpose/ajax.rb:65:in `post'
from /home/csong/.rvm/gems/ruby-2.2.0@vuln-tools/gems/nexpose-1.0.0/lib/nexpose/site.rb:557:in `save'

@@ -67,6 +67,7 @@ def self.for_service(name, id = -1, desc = nil, host = nil, port = nil, service
cred.port_restriction = port
cred.service = service
cred.scope = Credential::Scope::SITE_SPECIFIC
cred.permission_elevation_type = ElevationType::NONE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to prefix ElevationType::NONE with Credential. It should resolve fine here, but let's be explicit as possible!

Besides that :shipit:.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for Erran's comment, looks good otherwise. \(゚ー゚\)

sgreen-r7 added a commit that referenced this pull request May 12, 2015
Set default elevation type for credentials
@sgreen-r7 sgreen-r7 merged commit bd0bf65 into master May 12, 2015
@sgreen-r7 sgreen-r7 deleted the credentials branch May 12, 2015 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants