Skip to content

[Core Feature]: Simplify session handling #91

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

Open
ChriMarMe opened this issue May 10, 2022 · 0 comments
Open

[Core Feature]: Simplify session handling #91

ChriMarMe opened this issue May 10, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ChriMarMe
Copy link
Member

ChriMarMe commented May 10, 2022

At this moment session build up and handling is quite complex. We have ControlSession and Session with NewControlSession and NewSession functions in package core but also in package locking. The Initialize function of the locking package which builds a ControlSession and a NewSession function as a specific variation of Session for the purpose of the locking mechanism.

It is not easy to understand how to use sessions in a way to implement additional Opal/Enterprise features like TakeOwnership.

The specification describes two mechanisms for authentication in the context of sessions.

  1. Explicit - A session in existance can pass credentials to the device which then authorize the user. (This is implemented in the table package as ThisSP_Authenticate function. You can think of this as a rights elevation after session creation.
    TCG-Storage spec, p.188
  2. Implicit - The NewSession function gets additional parameters to create a session for the passed credentials and authenticates the user or admin in the process. TCG-Storage spec, p.132

While the spec describes ControlSessions and Sessions as seperate, I argue that we don't implement a session manager here and therefore we can wrap up ControlSession and Session build up to a single NewSession function which makes session handling easiers to understand and use. This would lead to the elimination of NewControlSession and NewSession in the locking package which means more seperation of concern. The locking mechanism shouldnt have anything to do with session handling. This should happen on an upper level of the library OR in the implementation of commands.

@ChriMarMe ChriMarMe added enhancement New feature or request help wanted Extra attention is needed labels May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant