aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-02-28 16:59:00 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-04-24 15:14:54 +0200
commit3c6fb1f4967eb5800179693768395f4e32ff293d (patch)
tree1f7d5e5030682219f5f1f6fb806dfe5ea5e6e6c8
parent11274884d2831cec722a16e8bf7fd83eda253c9b (diff)
Clean up/fixes
-rw-r--r--mod/jwt.hxx3
-rw-r--r--mod/mod-ci-github.cxx17
-rw-r--r--mod/mod-ci-github.hxx12
3 files changed, 16 insertions, 16 deletions
diff --git a/mod/jwt.hxx b/mod/jwt.hxx
index 97be0e9..b0df714 100644
--- a/mod/jwt.hxx
+++ b/mod/jwt.hxx
@@ -24,9 +24,6 @@ namespace brep
// the "issued at" time in order to combat potential clock drift (which can
// cause the token to be not valid yet).
//
- // @@ TODO Is there a standard term? "drift" or "drift value" seems to be
- // used quite often.
- //
// Return the token or throw std::system_error in case of an error.
//
string
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index cb781e3..e19a41b 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -10,7 +10,7 @@
#include <mod/module-options.hxx>
#include <stdexcept>
-#include <iostream>
+#include <iostream> // @@ TODO Remove once debug output has been removed.
// @@ TODO
//
@@ -22,6 +22,7 @@
//
// Webhooks:
// https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks
+// https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries
//
// REST API:
// https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28
@@ -85,6 +86,8 @@ namespace brep
for (const name_value& h: rq.headers ())
{
+ // This event's UUID.
+ //
if (icasecmp (h.name, "x-github-delivery") == 0)
{
// @@ TODO Check that delivery UUID has not been received before
@@ -104,6 +107,8 @@ namespace brep
content_type = true;
}
+ // The webhook event.
+ //
else if (icasecmp (h.name, "x-github-event") == 0)
{
if (!h.value)
@@ -513,7 +518,7 @@ namespace brep
if (!at) missing_member (p, "check_suite", "after");
}
- static ostream&
+ ostream&
gh::operator<< (ostream& os, const check_suite& cs)
{
os << "id: " << cs.id << endl
@@ -554,7 +559,7 @@ namespace brep
if (!db) missing_member (p, "repository", "default_branch");
}
- static ostream&
+ ostream&
gh::operator<< (ostream& os, const repository& rep)
{
os << "name: " << rep.name << endl
@@ -589,7 +594,7 @@ namespace brep
if (!i) missing_member (p, "installation", "id");
}
- static ostream&
+ ostream&
gh::operator<< (ostream& os, const installation& i)
{
os << "id: " << i.id << endl;
@@ -628,7 +633,7 @@ namespace brep
if (!in) missing_member (p, "check_suite_event", "installation");
}
- static ostream&
+ ostream&
gh::operator<< (ostream& os, const check_suite_event& cs)
{
os << "action: " << cs.action << endl;
@@ -678,7 +683,7 @@ namespace brep
if (!ea) missing_member (p, "installation_access_token", "expires_at");
}
- static ostream&
+ ostream&
gh::operator<< (ostream& os, const installation_access_token& t)
{
os << "token: " << t.token << endl;
diff --git a/mod/mod-ci-github.hxx b/mod/mod-ci-github.hxx
index ca6c7bf..9731881 100644
--- a/mod/mod-ci-github.hxx
+++ b/mod/mod-ci-github.hxx
@@ -4,8 +4,6 @@
#ifndef MOD_MOD_CI_GITHUB_HXX
#define MOD_MOD_CI_GITHUB_HXX
-#include <web/xhtml/fragment.hxx>
-
#include <libbrep/types.hxx>
#include <libbrep/utility.hxx>
@@ -95,19 +93,19 @@ namespace brep
installation_access_token () = default;
};
- static ostream&
+ ostream&
operator<< (ostream&, const check_suite&);
- static ostream&
+ ostream&
operator<< (ostream&, const repository&);
- static ostream&
+ ostream&
operator<< (ostream&, const installation&);
- static ostream&
+ ostream&
operator<< (ostream&, const check_suite_event&);
- static ostream&
+ ostream&
operator<< (ostream&, const installation_access_token&);
}