-
Notifications
You must be signed in to change notification settings - Fork 66
api/cloud: include short tokens in deregister query #72
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
Conversation
Some older cloud implementations expect the deregister requests to have access token in the query otherwise they regard the request as invalid. To support such implementations we append the token to query if the overall size of the request header is shorter or equal to COAP_MAX_HEADER_SIZE.
api/cloud/oc_cloud_apis.c
Outdated
if (oc_string(ctx->store.ci_server) && conv_cloud_endpoint(ctx) == 0 && | ||
cloud_access_deregister(ctx->cloud_ep, | ||
oc_string(ctx->store.uid), | ||
0, | ||
access_token, | ||
/*device*/0, |
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.
why there is 0 instead of the device?
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.
Not really sure, but looking in my original commit ( c91cba1 ) it seems that the value for device has been always zero.
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.
could you change it to the device?
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.
Which value shoud I use though, ctx->store.device?
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.
yes
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.
pls just use the device instead of 0 and @WAvdBeek as a reviewer.
Some older cloud implementations expect the deregister
requests to have access token in the query otherwise
they regard the request as invalid. To support such
implementations we append the token to query if
the overall size of the request header is shorter
or equal to COAP_MAX_HEADER_SIZE.