Rename user into identity
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -41,7 +41,7 @@ func RequireAPIKeyHandler(
|
||||
)
|
||||
|
||||
apiKey := connect_v1.APIKeyFromContext(ctx)
|
||||
identity := connect_v1.UserFromContext(ctx)
|
||||
identity := connect_v1.IdentityFromContext(ctx)
|
||||
if identity == nil {
|
||||
httpserver.RenderError(w, http.StatusUnauthorized, errors.New("authentication required"))
|
||||
return
|
||||
|
||||
@@ -19,7 +19,7 @@ type Resolver struct {
|
||||
}
|
||||
|
||||
func (r *Resolver) MustBeAuthorized(ctx context.Context, entityID gid.GID, action iam.Action) {
|
||||
user := connect_v1.UserFromContext(ctx)
|
||||
user := connect_v1.IdentityFromContext(ctx)
|
||||
apiKey := connect_v1.APIKeyFromContext(ctx)
|
||||
if user == nil {
|
||||
panic(&iam.TenantAccessError{Message: "authentication required"})
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
// ListOrganizationsTool handles the listOrganizations tool
|
||||
// List all organizations the user has access to
|
||||
func (r *Resolver) ListOrganizationsTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListOrganizationsInput) (*mcp.CallToolResult, types.ListOrganizationsOutput, error) {
|
||||
user := connect_v1.UserFromContext(ctx)
|
||||
user := connect_v1.IdentityFromContext(ctx)
|
||||
|
||||
organizations, err := r.iamSvc.AccountService.ListOrganizations(ctx, user.ID)
|
||||
if err != nil {
|
||||
@@ -1667,7 +1667,7 @@ func (r *Resolver) PublishDocumentVersionTool(ctx context.Context, req *mcp.Call
|
||||
|
||||
svc := r.ProboService(ctx, input.DocumentID)
|
||||
|
||||
user := connect_v1.UserFromContext(ctx)
|
||||
user := connect_v1.IdentityFromContext(ctx)
|
||||
|
||||
document, documentVersion, err := svc.Documents.PublishVersion(ctx, input.DocumentID, user.ID, input.Changelog)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user