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

Access elements from mongo_command #1

Open
rockandska opened this issue Apr 4, 2018 · 0 comments
Open

Access elements from mongo_command #1

rockandska opened this issue Apr 4, 2018 · 0 comments

Comments

@rockandska
Copy link

Hi,

I'm a bit new to Inspec, so sorry if my question is not relevant, but i don't get how I can access to the elements return by mongo_command.

Exemple of data return by "db.runCommand({connectionStatus : 1})"

{
	"authInfo" : {
		"authenticatedUsers" : [
			{
				"user" : "test",
				"db" : "test"
			}
		],
		"authenticatedUserRoles" : [
			{
				"role" : "dbOwner",
				"db" : "test"
			}
		]
	},
	"ok" : 1
}

How could access to the "role" key to test his value with something like bellow

describe mongo_command("db.runCommand({connectionStatus : 1})", username: mongo_username, password: mongo_password, verify_ssl: mongo_verify_ssl) do
    ...
end

Regards,

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

No branches or pull requests

1 participant