Make notary support enabled by default in morph client #905

Open
opened 2024-01-11 13:52:18 +00:00 by aarifullin · 0 comments
Collaborator

For now notary subsystem is widely used, so, the proposal is to enable notary support by default in morph client constructor.

To make this, we need to invoke EnableNotarySupport in constructor, but at the same it would be better to make this method deprecated to notify client to stop using this invocation explictly.

I suggest to create enableNotarySupport, copy the definition to there and make

// Deprecated: Notary support is enabled by default during client construction.
func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
  return c.enableNotarySupport(opts...) // also use in the constructor
}

Also, we need to avoid throwing panic-s like here, here etc.
It is required to make morph client non-panic-prone and return error instead panic.

Since, we're getting rid of EnableNotarySupport, we need to indroduce a method to disable the notary support enabled by default:

func (c *Client) DisableNotarySupport() {
  // ...
}
For now notary subsystem is widely used, so, the proposal is to enable [notary](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/client.go#L63) support by default in morph client [constructor](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/constructor.go#L93). To make this, we need to invoke [EnableNotarySupport](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/notary.go#L81-L115) in constructor, but at the same it would be better to make this method `deprecated` to notify client to stop using this invocation explictly. I suggest to create `enableNotarySupport`, copy the definition to there and make ```go // Deprecated: Notary support is enabled by default during client construction. func (c *Client) EnableNotarySupport(opts ...NotaryOption) error { return c.enableNotarySupport(opts...) // also use in the constructor } ``` Also, we need to avoid throwing `panic`-s like [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/notary.go#L152), [here](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/morph/client/constructor.go#L95) etc. It is required to make morph client non-panic-prone and return error instead `panic`. Since, we're getting rid of `EnableNotarySupport`, we need to indroduce a method to disable the notary support enabled by default: ```go func (c *Client) DisableNotarySupport() { // ... } ```
aarifullin added the
enhancement
label 2024-01-11 13:52:18 +00:00
fyrchik added the
frostfs-node
label 2024-01-11 17:29:44 +00:00
fyrchik added this to the v0.38.0 milestone 2024-01-11 17:30:02 +00:00
elebedeva was assigned by fyrchik 2024-01-16 11:56:27 +00:00
fyrchik modified the milestone from v0.38.0 to v0.39.0 2024-02-12 06:24:53 +00:00
fyrchik modified the milestone from v0.39.0 to vNext 2024-05-14 14:10:12 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#905
There is no content yet.