Added new method for EscapePod authentication & EscapePod examples #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
v, err := vector.NewEP(
vector.WithTarget(os.Getenv("BOT_TARGET")),
)
DEFECTS: This solution should be considered only as temporary, as each connection to EP robot will create its own token hash by calling UserAuthentication grpc, so the file at EP robot firmware /data/vic-gateway/token-hashes.json containing authenticated hashes will grow with each use of this SDK, until Token Hash file will consume all free space at robot's firmware and everything will crash. Received Token Hash should be rather stored locally for future re-usability.
EDIT: My mistake, there is no defect in the PR afterall, as because the constant "session token" in used for the authentication request, the previously generated token hash for that same "session" will get invalidated. So in fact, there should be always only one valid token hash for the given session - the currently received one. So in the end, it was correct, as nothing like token-hashes file overflow of newly generated tokens would ever happen...
However, for now, it seems that there is ONLY ONE valid token hash for the EP, no matter what "session id" is used in UserAuthentication request.? That, would on the other hand render the use of token hash stored on one device invalid, once the EP will be authenticated on another device...... This should be reviewed