Skip to content
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

Added new method for EscapePod authentication & EscapePod examples #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyb3rdog
Copy link

@cyb3rdog cyb3rdog commented Apr 9, 2021

  • added new 'NewEP' method for returning EscapePod Vector authenticated grpc client
  • usage:
    v, err := vector.NewEP(
    vector.WithTarget(os.Getenv("BOT_TARGET")),
    )
  • added new escape-pod examples into cmd/examples.escape-pod/*

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

…ed client

- usage:
	v, err := vector.NewEP(
		vector.WithTarget(os.Getenv("BOT_TARGET")),
	)
- added cmd/examples.escape-pod examples

Signed-off-by: cyb3rdog <[email protected]>
@cyb3rdog cyb3rdog closed this Apr 12, 2021
@cyb3rdog cyb3rdog reopened this Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant