Skip to content

Conversation

@djc
Copy link
Contributor

@djc djc commented Oct 21, 2024

Next step in #83. Currently untested.

r? @wez

@wez
Copy link
Collaborator

wez commented Oct 21, 2024

btw, you can run docs/build.sh to run the docs build, and docs/build.sh serve to run a local web server to view it in a browser.

@djc
Copy link
Contributor Author

djc commented Oct 21, 2024

btw, you can run docs/build.sh to run the docs build, and docs/build.sh serve to run a local web server to view it in a browser.

Ahh, that presupposes running Docker which I usually try to avoid. Also generates a bunch of diff:

diff --git a/docs/reference/kumod.openapi.json b/docs/reference/kumod.openapi.json
index db48fbbf..f6440451 100644
--- a/docs/reference/kumod.openapi.json
+++ b/docs/reference/kumod.openapi.json
@@ -6,7 +6,7 @@
     "license": {
       "name": "Apache-2.0"
     },
-    "version": "2024.10.15-3e4b6c13"
+    "version": "2024.10.15-46882b13"
   },
   "paths": {
     "/api/admin/bounce/v1": {
@@ -443,8 +443,7 @@
             "description": "The the preferred filename for the attachment",
             "nullable": true
           }
-        },
-        "additionalProperties": false
+        }
       },
       "BounceV1CancelRequest": {
         "type": "object",
@@ -682,8 +681,7 @@
             "example": "Sales",
             "nullable": true
           }
-        },
-        "additionalProperties": false
+        }
       },
       "Header": {
         "oneOf": [
@@ -744,8 +742,7 @@
           "trace_headers": {
             "$ref": "#/components/schemas/HttpTraceHeaders"
           }
-        },
-        "additionalProperties": false
+        }
       },
       "InjectV1Response": {
         "type": "object",
@@ -909,8 +906,7 @@
               "gender": "male"
             }
           }
-        },
-        "additionalProperties": false
+        }
       },
       "SetDiagnosticFilterRequest": {
         "type": "object",

@wez
Copy link
Collaborator

wez commented Oct 21, 2024

I think you need to run make test so that your kumod is built and will output the same openapi spec as is already checked in

@djc djc force-pushed the spf-lua branch 2 times, most recently from 3cf9624 to f6f335b Compare October 21, 2024 14:58
@djc djc force-pushed the spf-lua branch 4 times, most recently from 819dcd5 to 1711fdb Compare October 25, 2024 13:11
@djc
Copy link
Contributor Author

djc commented Oct 25, 2024

@wez I think this is ready for a round of review (dare I say: done?), seems to be in a decent shape.

@djc djc force-pushed the spf-lua branch 2 times, most recently from d097739 to d2456f3 Compare October 25, 2024 14:19
Copy link
Collaborator

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor nits really; this looks good, thank you!

@djc
Copy link
Contributor Author

djc commented Nov 4, 2024

(Mostly) addressed your feedback, let me know if there's anything else -- I'll start working on DMARC.

@wez wez merged commit a8d08f1 into KumoCorp:main Nov 7, 2024
@wez
Copy link
Collaborator

wez commented Nov 7, 2024

Looks good, thank you!

@wez
Copy link
Collaborator

wez commented Nov 7, 2024

one minor tweak I'm just going to commit and push here is that you can simplify this bit and let mlua handle the type conversion for you:

diff --git a/crates/mod-dns-resolver/src/lib.rs b/crates/mod-dns-resolver/src/lib.rs
index 823b6f30..2007205c 100644
--- a/crates/mod-dns-resolver/src/lib.rs
+++ b/crates/mod-dns-resolver/src/lib.rs
@@ -193,10 +193,10 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {

     dns_mod.set(
         "configure_test_resolver",
-        lua.create_function(move |lua, zones: mlua::Value| {
+        lua.create_function(move |_lua, zones: Vec<String>| {
             let mut resolver = TestResolver::default();
-            for zone in lua.from_value::<Vec<String>>(zones)? {
-                resolver = resolver.with_zone(&zone);
+            for zone in &zones {
+                resolver = resolver.with_zone(zone);
             }

             dns_resolver::reconfigure_resolver(resolver);

wez added a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants