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

Deprecate incorrectly named API #424

Merged
merged 10 commits into from
Mar 13, 2019

Commits on Mar 12, 2019

  1. 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
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    809a6a9 View commit details
    Browse the repository at this point in the history
  2. 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
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    a152a45 View commit details
    Browse the repository at this point in the history
  3. 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
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    b7bdef2 View commit details
    Browse the repository at this point in the history
  4. 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
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    5ab8a68 View commit details
    Browse the repository at this point in the history
  5. 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.
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    3266977 View commit details
    Browse the repository at this point in the history
  6. 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
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    ee6022f View commit details
    Browse the repository at this point in the history
  7. 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.
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    5b820e1 View commit details
    Browse the repository at this point in the history
  8. Use C constants directly

    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.
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    35e7dd9 View commit details
    Browse the repository at this point in the history
  9. Revert "Compatibility test for old Secure Session API"

    This reverts commit 5b820e1.
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    7967352 View commit details
    Browse the repository at this point in the history
  10. Revert "Rename session.SessionCallbacks interface"

    This reverts commit 3266977.
    ilammy committed Mar 12, 2019
    Configuration menu
    Copy the full SHA
    945ef75 View commit details
    Browse the repository at this point in the history