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
Added support for TenableAD license APIs #510
Conversation
1902086
to
29f2c82
Compare
29f2c82
to
dc7240e
Compare
tenable/ad/license/api.py
Outdated
def create(self, | ||
ad_license: str | ||
) -> Dict: | ||
''' | ||
Create new license singleton | ||
|
||
Args: | ||
ad_license (str): | ||
The AD license string object. | ||
|
||
Return: | ||
The license object | ||
|
||
Example: | ||
>>> tad.license.create( | ||
... ad_license='license' | ||
... ) | ||
''' | ||
payload = self._schema.dump(self._schema.load({ | ||
'license': ad_license | ||
})) |
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.
def create(self, | |
ad_license: str | |
) -> Dict: | |
''' | |
Create new license singleton | |
Args: | |
ad_license (str): | |
The AD license string object. | |
Return: | |
The license object | |
Example: | |
>>> tad.license.create( | |
... ad_license='license' | |
... ) | |
''' | |
payload = self._schema.dump(self._schema.load({ | |
'license': ad_license | |
})) | |
def create(self, license: str) -> Dict: | |
''' | |
Create new license singleton | |
Args: | |
license (str): | |
The license string object. | |
Return: | |
The license object | |
Example: | |
>>> tad.license.create( | |
... license='license' | |
... ) | |
''' | |
payload = self._schema.dump(self._schema.load({ | |
'license': license | |
})) |
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.
implemented suggested changes
tests/ad/license/test_license_api.py
Outdated
'type': 'license type' | ||
} | ||
) | ||
resp = api.license.create(ad_license='license') |
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.
resp = api.license.create(ad_license='license') | |
resp = api.license.create(license='license') |
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.
implemented suggested changes
@pre_load | ||
def convert(self, data, **kwargs): | ||
return convert_keys_to_camel(data, special=['search_user_dn']) | ||
return convert_keys_to_camel(data, special=[SEARCH_USER_DN]) |
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.
no longer necessary per #526
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.
removed pre_load method
tenable/ad/constants.py
Outdated
''' | ||
Constants | ||
''' | ||
|
||
# field-names constants that are required to be converted to | ||
# last word uppercase | ||
SEARCH_USER_DN: str = 'search_user_dn' # ad-ldap-configuration | ||
EXPIRATION_DATE_UTC: str = 'expiration_date_utc' # ad-license |
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.
no longer necessary per #526
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.
removed constants file
Added feature - TenableAD license APIs rebased to master and done requested changes
dc7240e
to
545a76e
Compare
Quality Gate passedIssues Measures |
Description
Added
Tenable.AD License APIs
updated docs to support license api details
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: