removed unnecessary code
This commit is contained in:
parent
2ee155687c
commit
f05052c32f
|
@ -1,9 +0,0 @@
|
|||
def identity(data):
|
||||
print("default:identity")
|
||||
print(data)
|
||||
return data
|
||||
|
||||
def nop(data):
|
||||
print("default:nop")
|
||||
print(data)
|
||||
return 1
|
|
@ -1,25 +0,0 @@
|
|||
from conductor.ConductorWorker import ConductorWorker
|
||||
import requests
|
||||
import json
|
||||
|
||||
def execute_keycloak_auth(task):
|
||||
print("Inside execution...")
|
||||
print(json.dumps(task))
|
||||
|
||||
response = requests.post(task["inputData"]["uri"],
|
||||
{"grant_type" : "client_credentials", "client_id" : task["inputData"]["client_id"], "client_secret" : task["inputData"]["client_secret"]})
|
||||
|
||||
if response.status_code == 200:
|
||||
print("Executed")
|
||||
return {'status': 'COMPLETED', 'output': { "token" : response.json()}, 'logs': ['one', 'two']}
|
||||
else:
|
||||
print(response.text)
|
||||
return {'status': 'FAILED', 'output' : {}, 'logs': ['one', 'two']}
|
||||
|
||||
def main():
|
||||
print('Starting Keycloak authenticator')
|
||||
cc = ConductorWorker('http://localhost:8080/api', 1, 0.1)
|
||||
cc.start('kc_auth', execute_keycloak_auth, True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in New Issue