Skip to content

Nextpertise/hostfact-python-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hostfact-python-proxy

How to use:

from hostfact_python_client import hostfact_client

client = hostfact_client.HostFact(url=f"https://hostfact-proxy.nextpertise.nl/proxy/your-hostfact-server.com", api_key="secret")
print(client.debtor.list())

Exception example, in this case no permission to show debtor:

from hostfact_python_client import hostfact_client

client = hostfact_client.HostFact(url=f"https://hostfact-proxy.nextpertise.nl/proxy/your-hostfact-server.com", api_key="secret")
print(client.debtor.show(Identifier=1))

Traceback (most recent call last):
  File "/hostfact-python-proxy/src/test.py", line 4, in <module>
    print(client.debtor.show(Identifier=1))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hostfact_python_client/hostfact_client.py", line 50, in call
    raise Exception(error)
Exception: HostFact error: {"detail":"debtor show not allowed for this client"}

Future ideas

  • Link API clients to specific Hostfact instance
  • Add expiry date to API keys

About

Add a security layer to our Hostfact API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published