-
Notifications
You must be signed in to change notification settings - Fork 310
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
Claim gateways using a QR code #7270
Comments
The |
Identical in what way? |
Will the implementation be the same? |
Commented on the PR, that's easier I think. |
Currently, the request for this endpoint looks like this (the format id is specified as a path argument, or it defaults to a format): message ParseGatewayQRCodeRequest {
string format_id = 1 [(validate.rules).string = {
pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$|^$",
max_len: 36
}];
// Raw QR code contents.
bytes qr_code = 2 [(validate.rules).bytes = {
min_len: 10,
max_len: 1024
}];
} From what I understand, the QR code will contain a URL. Will the URL be encoded when sending it to this endpoint in the qr_code field? Because if it's plain text, it will not pass the validation. What I mean is if it's simply sent like this: { "qr_code": "https://ttig.pro/c/ec656efffe000128/abcdef123456" } The endpoint will return the following error: {"code":3, "message":"proto: (line 1:14): invalid value for bytes type: \"https://ttig.pro/c/ec656efffe000128/abcdef123456\""} So the URL probably has to be in a base64 encoded form before passing it to the request. Does that make sense? Or would it be better to just change the type of the request field? (I left a comment here not in the issue because it might be relevant for fe too) |
Yeah I'm a bit conflicted on this. If we use |
This is done and tested |
Summary
Claim gateways using a QR code.
Current Situation
We can currently claim gateways using an EUI and an owner token.
Why do we need this? Who uses it, and when?
Users with a gateway QR code can claim it. This is very similar to claiming end devices.
Proposed Implementation
Backend:
GatewayQRCodeGenerator
service similar to the EndDeviceQRCodeGenerator with one single methodParse
.ParseGatewayQRCodeRequest
which is a copy of ParseEndDeviceQRCodeRequest, adjusted for gateways.AuthenticatedIdentifiers
filled; @johanstokking to confirm.ttigw001
with the rest of the interfaces/parsing fully adapted from the TR005 implementation.Frontend:
ParseGatewayQRCodeRequest
RPC, which will return a ClaimGatewayRequest with only the identifiers filled. Fill the rest of the fields (ex: Gateway ID, frequency plans etc) as with the current claiming flow and make a request to claim the gateway.Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: