Commit graph

22 commits

Author SHA1 Message Date
Evgenii Stratonikov
732dd51b1b [#388] *: Remove nil check from setters
I knew one day `sed` would save me an hour of manual work:
```
sed -i -n -e '
s/) Set/) Set/
p
t setter
b end
:setter
    n
    s/nil/nil/
    t hasif
    p
    b end
    :hasif
        n
        :loop
        p
        n
        s/}/}/
        t end
        b loop
        :end
' $@
goimports -w $@
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-31 11:32:04 +03:00
Evgenii Stratonikov
e21a7823c5 [#376] session: Make XHeader slice non-pointer
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Leonard Lyubich
fd3bf4a56b Fix linter remarks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 11:12:57 +03:00
Leonard Lyubich
227a871a04 [#367] session: Support magic_number field of RequestMetaHeader
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-14 13:17:21 +03:00
Leonard Lyubich
25da5d2e13 Add v2 version to go module name
Replace all elements from `v2` to root directory.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-17 15:29:33 +03:00
Alex Vanin
0a5d0ff1a2 Remove v1 code 2020-09-18 10:39:45 +03:00
Leonard Lyubich
af28735ca6 session: change PrivateToken interface methods
This commit replaces PublicKey() and SignData() methods of PrivateToken
with PrivateKey() in order to have the ability to sign data with
session key using service package functions.
2020-05-18 16:47:15 +03:00
Leonard Lyubich
af73d958a1 session: add OwnerID to a private token storage key 2020-05-08 13:23:30 +03:00
Leonard Lyubich
2c2150b101 session: move errors to a separate file 2020-05-08 12:37:56 +03:00
Leonard Lyubich
b079a7604f session: implement gRPC session creator 2020-05-08 12:34:16 +03:00
Leonard Lyubich
4fa7360cd1 session: support the expiration of private tokens
All sessions in NeoFS has limited in epochs lifetime. There is a need
to limit the lifetime of private session tokens.

This commmit:

  * extends PrivateToken interface with Expired method;

  * defines EpochLifetimeStore interface with RemoveExpired method
    and embeds it to PrivateTokenStore interface;

  * adds epoch value parameter to private token constructor.
2020-04-29 14:11:19 +03:00
Leonard Lyubich
608f578105 session: removes unused errors 2020-04-29 12:50:52 +03:00
Leonard Lyubich
79142ada04 session: replace used type aliases to separate file 2020-04-29 12:49:27 +03:00
Leonard Lyubich
701bbafcf1 session: change KeyStore documentation 2020-04-29 12:44:35 +03:00
Leonard Lyubich
22265a9f03 session: refactor token store
This commit:

  * changes the set and signatures of TokenStore interface methods;

  * adds unit test for map storage.
2020-04-29 12:39:41 +03:00
Leonard Lyubich
dfc2dd8a78 session: replace PToken structure with PrivateToken interface
In previous implementation PToken contained the full Token structure.
Since private token is used for data signature only, storing unused
fields of a user token is impractical. To emphasize the purpose of
the private part of the session, it makes sense to provide the user
of the session package with its interface. The interface will only provide
the functionality of data signing with private session key.

This commit:

  * removes PToken structure from session package;

  * defines PrivateToken interface of private session part;

  * adds the implementation of PrivateToken on unexported struct;

  * provides the constructor that generates session key internally.
2020-04-29 11:52:05 +03:00
Leonard Lyubich
4ac17201b7 Resolve update conflicts 2020-04-28 13:33:43 +03:00
Evgeniy Kulikov
b118f469d2
Migrate to new repo 2020-03-31 10:05:26 +03:00
Evgeniy Kulikov
53af48372f
prepare to rename neofs-proto to neofs-api 2020-01-30 16:35:30 +03:00
alexvanin
b556d54f16 session: Modify verify routine to check owner id connection with public keys 2020-01-17 13:18:36 +03:00
Evgeniy Kulikov
165dc9abd7
linter: fix doc comments issues 2019-11-21 13:01:08 +03:00
Evgeniy Kulikov
1cf33e5ffd
initial 2019-11-18 16:34:06 +03:00