-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix: remove create object & bucket approval #225
Conversation
client/api_basic.go
Outdated
// - ret1: The nonce value for the Client | ||
// | ||
// - ret2: Return error when getting next nonce failed, otherwise return nil. | ||
func (c *Client) GetNonceByAddr(ctx context.Context, address sdk.AccAddress) (uint64, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to clarify what kind of nonce here the SDK need to get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As SP off-chain-auth also did have a nonce concept, it would better to explain what nonce is it .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just redundant function for local test, i will delete it
client/api_bucket.go
Outdated
// - ret1: The msg of create bucket which contain the approval signature from the storage provider | ||
// | ||
// - ret2: Return error when get approval failed, otherwise return nil. | ||
func (c *Client) GetCreateBucketApproval(ctx context.Context, createBucketMsg *storageTypes.MsgCreateBucket) (*storageTypes.MsgCreateBucket, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to remove those old "getApproval" methods because we need make sure the change is backward compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an exported method. Clients code might have already used it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should not delete this part for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
client/api_bucket.go
Outdated
if err != nil { | ||
return "", err | ||
} | ||
|
||
families, err := c.QuerySpAvailableGlobalVirtualGroupFamilies(ctx, sp.Id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'd better use the optimal API to get one VGF here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
client/api_object.go
Outdated
@@ -34,7 +33,6 @@ import ( | |||
// IObjectClient interface defines functions related to object operations. | |||
// The concept of "object" is the same as the concept of the object in AWS S3 storage. | |||
type IObjectClient interface { | |||
GetCreateObjectApproval(ctx context.Context, createObjectMsg *storageTypes.MsgCreateObject) (*storageTypes.MsgCreateObject, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to delete this API for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
strings.Contains(objectName, "\\") || | ||
utils.IsSQLInjection(objectName) { | ||
return "", fmt.Errorf("fail to check object name:%s", objectName) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you wrap these format check codes into a single function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also move the object name rules into the CheckObjectName function, not comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckObjectName already has the same comments, so i just delete it
@@ -1031,59 +1037,6 @@ func (c *Client) ListObjects(ctx context.Context, bucketName string, opts types. | |||
return listObjectsResult, nil | |||
} | |||
|
|||
// GetCreateObjectApproval returns the signature info for the approval of preCreating resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Deprecated: GetCreateObjectApproval returns the signature info for the approval of preCreating resources
No need to delete this API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean change the comment to other than delete this line:
// Deprecated: GetCreateObjectApproval returns the signature info for the approval of preCreating resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same to GetCreateBucketApproval API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # go.mod # go.sum
Description
Remove the create object approval & create bucket approval, and during the process of creating objects & buckets, the calls to the SP side are eliminated through the Go-sdk.
Rationale
Example
N/A
Changes
Notable changes: