Skip to content

Implement PAP-SHA256 auth mechanism #243

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

Closed
oleg-jukovec opened this issue Dec 1, 2022 · 2 comments · Fixed by #250
Closed

Implement PAP-SHA256 auth mechanism #243

oleg-jukovec opened this issue Dec 1, 2022 · 2 comments · Fixed by #250
Assignees

Comments

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Dec 1, 2022

We need to support a new authorization mechanizm PAP-SHA256, RFC:

https://www.notion.so/tarantool/Authentication-methods-908501aa74834bdea70c384d6df97105

We need:

  1. To add Opts.AuthType to force 'chap-sha1' or 'pap-sha256' authorization method here:
    type Opts struct {
  2. To check IPROTO_AUTH_TYPE = 0x5bhere:

    go-tarantool/response.go

    Lines 195 to 210 in d6d0031

    case KeyVersion:
    if err = d.Decode(&serverProtocolInfo.Version); err != nil {
    return err
    }
    case KeyFeatures:
    if larr, err = d.DecodeArrayLen(); err != nil {
    return err
    }
    serverProtocolInfo.Features = make([]ProtocolFeature, larr)
    for i := 0; i < larr; i++ {
    if err = d.Decode(&feature); err != nil {
    return err
    }
    serverProtocolInfo.Features[i] = feature
    }

    and add the information about auth type to IdRequest response.
  3. To choose an authorization method by priority: Opts.AuthType -> IPROTO_AUTH_TYPE -> 'chap-sha1' (default).
  4. To implement the method pap-sha256 for authReques according to the RFC:
    https://github.com/tarantool/go-tarantool/blob/d6d0031d7a0ce9959edf57f9407bba9652a37506/auth.go

    go-tarantool/request.go

    Lines 598 to 603 in d6d0031

    func (req *authRequest) Body(res SchemaResolver, enc *encoder) error {
    return enc.Encode(map[uint32]interface{}{
    KeyUserName: req.user,
    KeyTuple: []interface{}{string("chap-sha1"), string(req.scramble)},
    })
    }

The connector should refuse to use PAP-SHA256 unless the network channel is encrypted with SSL/TLS.

Linked issues:

tarantool/tarantool#7987
tarantool/tarantool#7988
tarantool/tarantool#7989
https://github.com/tarantool/tarantool-ee/issues/295
https://github.com/tarantool/enterprise_doc/issues/206

@LeonidVas
Copy link

To be implemented in the EE-version of the connector.

@LeonidVas
Copy link

The bosses turn the wheel one more time. We implement this feature here.

oleg-jukovec added a commit that referenced this issue Dec 21, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 25, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 26, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 27, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 27, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 28, 2022
The authentication method works only with Tarantool EE [1].

1. tarantool/enterprise_doc#206

Closes #243
oleg-jukovec added a commit that referenced this issue Dec 28, 2022
Overview

    The release improves compatibility with new Tarantool versions.

Breaking changes

    There are no breaking changes in the release.

New features

    Support iproto feature discovery (#120).

    Support errors extended information (#209).

    Support error type in MessagePack (#209).

    Support event subscriptin (#119).

    Support session settings (#215).

    Support pap-sha256 authorization method (Tarantool EE
    feature) (#243).

    Support graceful shutdown (#214).

Bugfixes

    Decimal package uses a test variable DecimalPrecision instead
    of a package-level variable decimalPrecision (#233).

    Flaky test TestClientRequestObjectsWithContext (#244).

    Flaky test multi/TestDisconnectAll (#234).
oleg-jukovec added a commit that referenced this issue Dec 29, 2022
Overview

    The release improves compatibility with new Tarantool versions.

Breaking changes

    There are no breaking changes in the release.

New features

    Support iproto feature discovery (#120).

    Support errors extended information (#209).

    Support error type in MessagePack (#209).

    Support event subscription (#119).

    Support session settings (#215).

    Support pap-sha256 authorization method (Tarantool EE
    feature) (#243).

    Support graceful shutdown (#214).

Bugfixes

    Decimal package uses a test variable DecimalPrecision instead
    of a package-level variable decimalPrecision (#233).

    Flaky test TestClientRequestObjectsWithContext (#244).

    Flaky test multi/TestDisconnectAll (#234).
oleg-jukovec added a commit that referenced this issue Dec 30, 2022
Overview

    The release improves compatibility with new Tarantool versions.

Breaking changes

    There are no breaking changes in the release.

New features

    Support iproto feature discovery (#120).

    Support errors extended information (#209).

    Support error type in MessagePack (#209).

    Support event subscription (#119).

    Support session settings (#215).

    Support pap-sha256 authorization method (Tarantool EE
    feature) (#243).

    Support graceful shutdown (#214).

Bugfixes

    Decimal package uses a test variable DecimalPrecision instead
    of a package-level variable decimalPrecision (#233).

    Flaky test TestClientRequestObjectsWithContext (#244).

    Flaky test multi/TestDisconnectAll (#234).
pull bot pushed a commit to kokizzu/go-tarantool that referenced this issue Jan 1, 2023
Overview

    The release improves compatibility with new Tarantool versions.

Breaking changes

    There are no breaking changes in the release.

New features

    Support iproto feature discovery (tarantool#120).

    Support errors extended information (tarantool#209).

    Support error type in MessagePack (tarantool#209).

    Support event subscription (tarantool#119).

    Support session settings (tarantool#215).

    Support pap-sha256 authorization method (Tarantool EE
    feature) (tarantool#243).

    Support graceful shutdown (tarantool#214).

Bugfixes

    Decimal package uses a test variable DecimalPrecision instead
    of a package-level variable decimalPrecision (tarantool#233).

    Flaky test TestClientRequestObjectsWithContext (tarantool#244).

    Flaky test multi/TestDisconnectAll (tarantool#234).
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 a pull request may close this issue.

2 participants