-
Notifications
You must be signed in to change notification settings - Fork 112
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
Invite manager "api" for use with NC/OC-10 #3967
Conversation
…t's api Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
…t's api Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
Signed-off-by: MohammadReza vahedi <[email protected]>
return it, nil | ||
} | ||
|
||
func (c *Client) ListTokens(ctx context.Context, initiator *userpb.UserId) ([]*invitepb.InviteToken, 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.
exported method Client.ListTokens should have comment or be unexported
} | ||
|
||
func (c *Client) doGetAllRemoteUsers(initiator string, search string) ([]*apiOCMUser, error) { | ||
requestUrl := c.Config.BaseURL + "/api/v1/find_remote_user/" + initiator + "?search=" + search |
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.
var requestUrl should be requestURL
} | ||
|
||
func (c *Client) doGetRemoteUser(initiator string, opaque_user_id string, idp string) (*apiOCMUser, error) { | ||
requestUrl := c.Config.BaseURL + "/api/v1/get_remote_user/" + initiator + "?userId=" + opaque_user_id + "&idp=" + idp |
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.
var requestUrl should be requestURL
return true, nil | ||
} | ||
|
||
func (c *Client) doGetRemoteUser(initiator string, opaque_user_id string, idp string) (*apiOCMUser, 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.
don't use underscores in Go names; method parameter opaque_user_id should be opaqueUserID
if err != nil { | ||
return false, err | ||
} | ||
requestUrl := c.Config.BaseURL + "/api/v1/add_remote_user/" + initiator |
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.
var requestUrl should be requestURL
return result, nil | ||
} | ||
|
||
func (c *Client) doPostRemoteUser(initiator string, opaque_user_id string, idp string, email string, display_name string) (bool, 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.
don't use underscores in Go names; method parameter display_name should be displayName
don't use underscores in Go names; method parameter opaque_user_id should be opaqueUserID
} | ||
|
||
func (c *Client) doGetAllTokens(initiator string) ([]*apiToken, error) { | ||
requestUrl := c.Config.BaseURL + "/api/v1/tokens_list/" + initiator |
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.
var requestUrl should be requestURL
} | ||
|
||
func (c *Client) doGetToken(token string) (*apiToken, error) { | ||
requestUrl := c.Config.BaseURL + "/api/v1/get_token" + "?token=" + token |
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.
var requestUrl should be requestURL
return false, err | ||
} | ||
|
||
requestUrl := c.Config.BaseURL + "/api/v1/add_token/" + initiator |
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.
var requestUrl should be requestURL
|
||
type config struct { | ||
BaseURL string `mapstructure:"base_url"` | ||
ApiKey string `mapstructure:"api_key"` |
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.
struct field ApiKey should be APIKey
Maybe "api" as name is too generic? I would call it "nextcloud" or "owncloud", like in the ocm share provider |
@mrvahedi68 can you resolve the Hound smells and answer the reviewer comment above? Also, I'm seeing this in the mesh.pondersource.org logs:
do you know what might cause that?
|
It is for missing |
Superseded by #4115 |
With this invite manager, OCM invites (both pending and accepted) will be stored in your EFSS instead of inside the revad server in a
/var/tmp/reva/ocm-invites.json
file which is the current standard behaviour for NC/OC-10 based ScienceMesh sites.