[cpp-sp] branch main updated: Add discrete year tests.
Scott Cantor
cantor.2 at osu.edu
Mon Oct 27 21:26:50 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository cpp-sp.
View the commit online:
https://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=ea852dc755cba15899d6c49693f90cae815d29a9
The following commit(s) were added to refs/heads/main by this push:
new ea852dc7 Add discrete year tests.
ea852dc7 is described below
commit ea852dc755cba15899d6c49693f90cae815d29a9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Oct 27 17:26:42 2025 -0400
Add discrete year tests.
---
tests/data/impl/acl/time/inline-year-invalid.xml | 4 +++
tests/data/impl/acl/time/inline-year-valid.xml | 4 +++
tests/impl/TimeAccessControlTests.cpp | 38 +++++++++++++++++++++++-
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/tests/data/impl/acl/time/inline-year-invalid.xml b/tests/data/impl/acl/time/inline-year-invalid.xml
new file mode 100644
index 00000000..92262ba0
--- /dev/null
+++ b/tests/data/impl/acl/time/inline-year-invalid.xml
@@ -0,0 +1,4 @@
+<AccessControlProvider type="Time" operator="AND">
+ <Year>LT 2000</Year>
+</AccessControlProvider>
+
diff --git a/tests/data/impl/acl/time/inline-year-valid.xml b/tests/data/impl/acl/time/inline-year-valid.xml
new file mode 100644
index 00000000..e07754f6
--- /dev/null
+++ b/tests/data/impl/acl/time/inline-year-valid.xml
@@ -0,0 +1,4 @@
+<AccessControlProvider type="Time" operator="AND">
+ <Year>LT 3000</Year>
+</AccessControlProvider>
+
diff --git a/tests/impl/TimeAccessControlTests.cpp b/tests/impl/TimeAccessControlTests.cpp
index 34dd5aa9..c82d1706 100644
--- a/tests/impl/TimeAccessControlTests.cpp
+++ b/tests/impl/TimeAccessControlTests.cpp
@@ -260,4 +260,40 @@ BOOST_FIXTURE_TEST_CASE(TimeAccessControl_inline_NewTimeInvalid, TimeAccessContr
BOOST_CHECK_EQUAL(acl->authorized(request, &session), AccessControl::shib_acl_false);
}
-};
\ No newline at end of file
+BOOST_FIXTURE_TEST_CASE(TimeAccessControl_inline_YearValid, TimeAccessControlFixture)
+{
+ parse("inline-year-valid.xml");
+ BOOST_CHECK_EQUAL(tree.size(), 1);
+
+ unique_ptr<AccessControl> acl(AgentConfig::getConfig().AccessControlManager.newPlugin(
+ tree.front().second.get<string>("<xmlattr>.type").c_str(), tree.front().second, true));
+
+#ifdef HAVE_CXX14
+ shared_lock locker(*acl);
+#endif
+
+ MappableDummyRequest request;
+ DummySession session;
+
+ BOOST_CHECK_EQUAL(acl->authorized(request, &session), AccessControl::shib_acl_true);
+}
+
+BOOST_FIXTURE_TEST_CASE(TimeAccessControl_inline_YearInvalid, TimeAccessControlFixture)
+{
+ parse("inline-year-invalid.xml");
+ BOOST_CHECK_EQUAL(tree.size(), 1);
+
+ unique_ptr<AccessControl> acl(AgentConfig::getConfig().AccessControlManager.newPlugin(
+ tree.front().second.get<string>("<xmlattr>.type").c_str(), tree.front().second, true));
+
+#ifdef HAVE_CXX14
+ shared_lock locker(*acl);
+#endif
+
+ MappableDummyRequest request;
+ DummySession session;
+
+ BOOST_CHECK_EQUAL(acl->authorized(request, &session), AccessControl::shib_acl_false);
+}
+
+};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list