Skip to content

Commit

Permalink
Revert "[ssi] credential issuance business events"
Browse files Browse the repository at this point in the history
This reverts commit 5ec1e58.
  • Loading branch information
patatoid committed Jan 24, 2025
1 parent f146899 commit ff62f81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@ defmodule BorutaWeb.Openid.CredentialController do
end

@impl Boruta.Openid.CredentialApplication
def credential_created(conn, %CredentialResponse{token: token} = credential_response) do
:telemetry.execute(
[:authorization, :credential, :success],
%{},
%{
client_id: token.client.id,
sub: token.sub,
access_token: token.value
}
)

def credential_created(conn, %CredentialResponse{} = credential_response) do
conn
|> put_view(OauthView)
|> render("credential.json", credential_response: credential_response)
Expand All @@ -51,16 +41,6 @@ defmodule BorutaWeb.Openid.CredentialController do
error: error,
error_description: error_description
}) do
:telemetry.execute(
[:authorization, :credential, :failure],
%{},
%{
status: status,
error: error,
error_description: error_description
}
)

conn
|> put_status(status)
|> put_view(OauthView)
Expand Down
62 changes: 0 additions & 62 deletions apps/boruta_web/lib/boruta_web/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ defmodule BorutaWeb.Logger do
[:authorization, :token, :failure],
&__MODULE__.authorization_token_failure_handler/4
},
{
:authorization_credential_success,
[:authorization, :credential, :success],
&__MODULE__.authorization_credential_success_handler/4
},
{
:authorization_credential_failure,
[:authorization, :credential, :failure],
&__MODULE__.authorization_credential_failure_handler/4
},
{
:authorization_introspect_success,
[:authorization, :introspect, :success],
Expand Down Expand Up @@ -224,58 +214,6 @@ defmodule BorutaWeb.Logger do
Logger.log(:info, fn -> log_line end, type: :business)
end

def authorization_credential_success_handler(
_,
_measurements,
%{
client_id: client_id,
sub: sub,
access_token: access_token
},
_
) do
log_line = [
"boruta_web",
?\s,
"authorization",
?\s,
"credential",
" - ",
"success",
log_attribute("client_id", client_id),
log_attribute("sub", sub),
log_attribute("access_token", access_token)
]

Logger.log(:info, fn -> log_line end, type: :business)
end

def authorization_credential_failure_handler(
_,
_measurements,
%{
status: status,
error: error,
error_description: error_description
},
_
) do
log_line = [
"boruta_web",
?\s,
"authorization",
?\s,
"credential",
" - ",
"failure",
log_attribute("status", status),
log_attribute("error", error),
log_attribute("error_description", ~s{"#{error_description}"})
]

Logger.log(:info, fn -> log_line end, type: :business)
end

def authorization_introspect_success_handler(
_,
_measurements,
Expand Down

0 comments on commit ff62f81

Please sign in to comment.