forked from softlayer/softlayer-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request softlayer#2139 from allmightyspiff/internalAuth
Adding support for internal styles of authentication
- Loading branch information
Showing
22 changed files
with
646 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
This document is for internal users wanting to use this library to interact with the internal API. It will not work for `api.softlayer.com`. | ||
|
||
|
||
## Certificate Example | ||
|
||
For use with a utility certificate. In your config file (usually `~/.softlayer`), you need to set the following: | ||
|
||
``` | ||
[softlayer] | ||
endpoint_url = https://<internal api endpoint>/v3/internal/rest/ | ||
timeout = 0 | ||
theme = dark | ||
auth_cert = /etc/ssl/certs/my_utility_cert-dev.pem | ||
server_cert = /etc/ssl/certs/allCAbundle.pem | ||
``` | ||
|
||
`auth_cert`: is your utility user certificate | ||
`server_cert`: is the CA certificate bundle to validate the internal API ssl chain. Otherwise you get self-signed ssl errors without this. | ||
|
||
|
||
``` | ||
import SoftLayer | ||
import logging | ||
import click | ||
@click.command() | ||
def testAuthentication(): | ||
client = SoftLayer.CertificateClient() | ||
result = client.call('SoftLayer_Account', 'getObject', id=12345, mask="mask[id,companyName]") | ||
print(result) | ||
if __name__ == "__main__": | ||
logger = logging.getLogger() | ||
logger.addHandler(logging.StreamHandler()) | ||
logger.setLevel(logging.DEBUG) | ||
testAuthentication() | ||
``` | ||
|
||
## Employee Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.