<% content_for :title, "DSN - #{@dsn.name}" %>

<%= @dsn.name %>

<%= @dsn.enabled? ? 'Enabled' : 'Disabled' %>
<%= link_to "Back to DSNs", dsns_path, class: "inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50" %> <% if policy(@dsn).edit? %> <%= link_to "Edit", edit_dsn_path(@dsn), class: "inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700" %> <% end %>

DSN Information

DSN key details and usage information.

Name
<%= @dsn.name %>
Complete DSN URL

Use this complete URL in your agent configuration:

<%= @dsn.full_dsn_url %>
API Endpoint
<%= @dsn.api_endpoint_url %>
DSN Key (for manual auth)
<%= @dsn.key %>
Status
<%= @dsn.enabled? ? 'Enabled' : 'Disabled' %>
Created
<%= @dsn.created_at.strftime('%B %d, %Y at %I:%M %p') %>
<% if @dsn.updated_at != @dsn.created_at %>
Last Updated
<%= @dsn.updated_at.strftime('%B %d, %Y at %I:%M %p') %>
<% end %>
<% if policy(@dsn).disable? || policy(@dsn).enable? %>

Actions

<% if @dsn.enabled? && policy(@dsn).disable? %> <%= button_to "Disable DSN", disable_dsn_path(@dsn), method: :post, data: { turbo_confirm: "Are you sure you want to disable this DSN? Agents will no longer be able to authenticate with this key." }, class: "inline-flex items-center px-4 py-2 border border-red-300 rounded-md shadow-sm text-sm font-medium text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %> <% elsif !@dsn.enabled? && policy(@dsn).enable? %> <%= button_to "Enable DSN", enable_dsn_path(@dsn), method: :post, class: "inline-flex items-center px-4 py-2 border border-green-300 rounded-md shadow-sm text-sm font-medium text-green-700 bg-white hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500" %> <% end %>
<% end %>

Usage Instructions

How to use this DSN key with your baffle-agents.

HTTP Header Authentication

Include the DSN key in the Authorization header:

Authorization: Bearer <%= @dsn.key %>

Query Parameter Authentication

Include the DSN key as a query parameter:

/api/events?baffle_key=<%= @dsn.key %>

X-Baffle-Auth Header

Use the custom Baffle authentication header:

X-Baffle-Auth: Baffle baffle_key=<%= @dsn.key %>, baffle_version=1