-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for storing RDP licenses from Windows Desktops #51250
Conversation
1341a7a
to
75379f9
Compare
item := backend.Item{ | ||
Key: p.rdpLicenseKey(version, issuer, company, productID), | ||
Value: license, | ||
Expires: p.BackendStorage.Clock().Now().Add(28 * 24 * time.Hour), |
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.
Any particular reason behind the 28d expiration? Maybe add a comment?
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.
Looks good, just waiting for a resolution on #51250 (comment). |
Co-authored-by: Alan Parra <[email protected]>
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.
Looks good, Przemko. Thanks for all the changes.
Please address the final comments.
@@ -543,3 +543,11 @@ func checkNameAndScreenSize(name string, screenSize *Resolution) error { | |||
} | |||
return nil | |||
} | |||
|
|||
// RDPLicenseKey is struct for retrieving licenses from backend cache, used only internally |
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.
If this type is only used internally then it probably shouldn't exist in the api module.
|
||
// WriteRDPLicense writes an RDP license to local storage. | ||
func (p *ProcessStorage) WriteRDPLicense(ctx context.Context, key *types.RDPLicenseKey, license []byte) error { | ||
value, err := json.Marshal(rdpLicense{Data: license}) |
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.
If you are still working here it's worth checking if key is nil, both in this method and the Read.
@probakowski See the table below for backport results.
|
Windows desktop can send license during initial exchange, the client should store it and send it again during future connections. We have this already implemented in v14 in rdp-rs, this change adds it to the newer versions using recent changes in IronRDP (Devolutions/IronRDP#634).
Storing and retrieving licenses on the Go side inspired by #47634
changelog: Add support for storing RDP licenses from Windows Desktops