Espone API JSON e MCP HTTP per far lavorare gli agenti sul CRM.

Gli agenti autenticati con token Bearer possono leggere today/pipeline e annotare attività, con host MCP allineati a quelli di produzione.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-02 22:43:46 +02:00
co-authored by Cursor
parent 1f946f63ba
commit 936930e691
44 changed files with 1693 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
class ApiTokensController < ApplicationController
before_action :set_api_token, only: :destroy
def index
@page_title = "Token API"
@api_tokens = current_user.api_tokens.active.order(created_at: :desc)
@revealed_token = session.delete(:revealed_api_token)
end
def create
token = ApiToken.issue!(user: current_user, name: params[:name])
session[:revealed_api_token] = token.plaintext
redirect_to api_tokens_path, notice: "Token creato. Copialo ora: non sarà più visibile."
end
def destroy
@api_token.revoke!
redirect_to api_tokens_path, notice: "Token revocato."
end
private
def set_api_token
@api_token = current_user.api_tokens.active.find(params[:id])
end
end