summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
7526ba2)
The token is follow below rfc:
https://www.rfc-editor.org/rfc/rfc7519
Doc Ref:
https://jwt.io/introduction
Signed-off-by: dliu5 <david.liu@windriver.com>
Change-Id: I0b850b3c7428c2f70e0eb19768e38a8b86607d12
ocloud_global_id = 4e24b97c-8c49-4c4f-b53e-3de5235a4e37
smo_register_url = http://127.0.0.1:8090/register
ocloud_global_id = 4e24b97c-8c49-4c4f-b53e-3de5235a4e37
smo_register_url = http://127.0.0.1:8090/register
+smo_token_data = smo_token_payload
@retry((ConnectionRefusedError), tries=2, delay=2)
def call_smo(reg_data: dict):
@retry((ConnectionRefusedError), tries=2, delay=2)
def call_smo(reg_data: dict):
+ smo_token = conf.DEFAULT.smo_token_data
+ smo_token_info = {
+ 'iss': 'o2ims',
+ 'aud': 'smo',
+ 'smo_token_payload': smo_token,
+ 'smo_token_type': 'jwt',
+ 'smo_token_expiration': '',
+ 'smo_token_algo': 'RS256'
+ }
+
callback_data = json.dumps({
'consumerSubscriptionId': reg_data['globalcloudId'],
'notificationEventType': 'CREATE',
'objectRef': config.get_api_url(),
callback_data = json.dumps({
'consumerSubscriptionId': reg_data['globalcloudId'],
'notificationEventType': 'CREATE',
'objectRef': config.get_api_url(),
- 'postObjectState': reg_data
+ 'postObjectState': reg_data,
+ 'smo_token_data': smo_token_info
})
logger.info('URL: {}, data: {}'.format(
conf.DEFAULT.smo_register_url, callback_data))
})
logger.info('URL: {}, data: {}'.format(
conf.DEFAULT.smo_register_url, callback_data))
o = urlparse(conf.DEFAULT.smo_register_url)
conn = http.client.HTTPConnection(o.netloc)
headers = {'Content-type': 'application/json'}
o = urlparse(conf.DEFAULT.smo_register_url)
conn = http.client.HTTPConnection(o.netloc)
headers = {'Content-type': 'application/json'}