-
Notifications
You must be signed in to change notification settings - Fork 143
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
Deprecate incorrectly named API #424
Deprecate incorrectly named API #424
Commits on Mar 12, 2019
-
Rename cell.CELL_MODE_* constants
- Provide new names that don't offend golint - Use new names throughout the code base - Mark the old names deprecated and redefine constants using new values
Configuration menu - View commit details
-
Copy full SHA for 809a6a9 - Browse repository at this point
Copy the full SHA 809a6a9View commit details -
Rename compare.COMPARE_* constants
- Provide new names that don't offend golint - Use new names throughout the code base - Mark the old names deprecated and redefine constants using new values
Configuration menu - View commit details
-
Copy full SHA for a152a45 - Browse repository at this point
Copy the full SHA a152a45View commit details -
Rename keys.KEYTYPE_* constants
- Provide new names that don't offend golint - Use new names throughout the code base - Mark the old names deprecated and redefine constants using new values
Configuration menu - View commit details
-
Copy full SHA for b7bdef2 - Browse repository at this point
Copy the full SHA b7bdef2View commit details -
Rename session.STATE_* constants
- Provide new names that don't offend golint - Use new names throughout the code base - Mark the old names deprecated and redefine constants using new values
Configuration menu - View commit details
-
Copy full SHA for 5ab8a68 - Browse repository at this point
Copy the full SHA 5ab8a68View commit details -
Rename session.SessionCallbacks interface
This renaming is more involved that other ones. Interfaces are hard. First of all, introduce a new interface with identifiers that do not offend golint: - use "Callbacks" instead of "SessionCallbacks" to avoid stuttering when importing (it will be called "session.Callbacks" in user code) - use "GetPublicKeyID" method name instead of "GetPublicKeyId" Then update all existing code to use the new interface. Secure Session itself should call the new method, accept and store Callbacks instance. Users of Secure Session should implement the new GetPublicKeyID method. However, in order to maintain backwards compatibility we have to allow the old code to continue using the old SessionCallbacks interface with GetPublicKeyId method. We implement this using an adapter struct that translates new method calls into the old ones. Since Go does not have method overloading we have to accept an "interface {}" instance and check its type dynamically. These compatibility shims can be removed when we drop the old interface.
Configuration menu - View commit details
-
Copy full SHA for 3266977 - Browse repository at this point
Copy the full SHA 3266977View commit details -
Rename session.SecureSession.GetRemoteId method
- Provide new name that don't offend golint - Use the new name throughout the code base - Mark the old method deprecated and reimplement it using the new one
Configuration menu - View commit details
-
Copy full SHA for ee6022f - Browse repository at this point
Copy the full SHA ee6022fView commit details -
Compatibility test for old Secure Session API
All these dynamic checks in session.New() warrant a test which verifies that we actually can handle the old interface values and reject invalid ones. This test can be removed together with the old SessionCallbacks API.
Configuration menu - View commit details
-
Copy full SHA for 5b820e1 - Browse repository at this point
Copy the full SHA 5b820e1View commit details -
It turns out that CGo actually does export C defines as Go constants, therefore we don't need to use intermediate variables for that. Previous code actually does not compile with Go 1.9.2 that we have on CI, but it is fine with my Go 1.12. The new code is fine in both environments.
Configuration menu - View commit details
-
Copy full SHA for 35e7dd9 - Browse repository at this point
Copy the full SHA 35e7dd9View commit details -
Revert "Compatibility test for old Secure Session API"
This reverts commit 5b820e1.
Configuration menu - View commit details
-
Copy full SHA for 7967352 - Browse repository at this point
Copy the full SHA 7967352View commit details -
Revert "Rename session.SessionCallbacks interface"
This reverts commit 3266977.
Configuration menu - View commit details
-
Copy full SHA for 945ef75 - Browse repository at this point
Copy the full SHA 945ef75View commit details