aboutsummaryrefslogtreecommitdiff
path: root/perl/t
AgeCommit message (Collapse)Author
2018-06-03Fix skipping in verifier/netdb testRuss Allbery
If AUTHOR_TESTING wasn't set, the test would plan twice. Fix this by restructuring it to delay printing a plan and convert the Kerberos ticket test to a skip_all plan.
2018-06-03Add SPDX-License-Identifier headersRuss Allbery
Add SPDX-License-Identifier headers to all substantial source files. Collapse copyright years. Add some Emacs configuration for files where the copyright notice is at the end. Add a test that every file has SPDX-License-Identifier.
2018-05-27Add obsolete-strings test and fix problems it findsRuss Allbery
Mostly changing http eyrie.org URLs to https, but also remove my old email address in one place and switch some tests away from my old RRA_MAINTAINER_TESTS environment variable to use the Lancaster Consensus variables properly. This uncovered a bug in skipping one test unless Stanford Kerberos credentials existed.
2018-05-27Update to rra-c-util 7.2 and C TAP Harness 4.3Russ Allbery
Update to rra-c-util 7.2: * Improve configure output for krb5-config testing. * Define UINT32_MAX for systems that don't have it. * Add SPDX-License-Identifier headers to all substantial source files. * Fix new warnings from GCC 7 and Clang warnings. * Require Test::Strict 0.25 or later to run those tests. * Fix off-by-one error in return-value checks for snprintf. * Use Autoconf to probe for supported warning flags. * Fix running module-version-t -u with current versions of Perl. * Use C_TAP_SOURCE and C_TAP_BUILD instead of SOURCE and BUILD. Update to C TAP Harness 4.3: * Add support for valgrind and libtool in test lists. * Report test failures as left and right, not wanted and expected. * Fix string comparisons with NULL pointers and the string "(null)". * Add SPDX-License-Identifier headers to all substantial source files. * Avoid zero-length realloc allocations in breallocarray. * Fix new warnings from GCC 7 and Clang warnings. * Use C_TAP_SOURCE and C_TAP_BUILD instead of SOURCE and BUILD.
2016-01-16Pass object type and name to external ACL verifiersRuss Allbery
This requires changing the ACL verifier plumbing to pass object type and name all the way through when verifying ACLs. Hopefully I caught everything.
2016-01-03Clean up test-files directory after object/password testRuss Allbery
2016-01-03Fix t/object/keytab.t MIT enctype recognitionRuss Allbery
New versions of MIT now use the actual enctype in klist -ke output. Also add 128-bit AES. Also add some additional debugging that was useful when chasing another problem.
2016-01-03Add Wallet::ACL::External ACL typeRuss Allbery
A new ACL type, external (Wallet::ACL::External), is now supported. This ACL runs an external command to check if access is allowed, and passes the principal and the ACL identifier to that command. To enable this ACL type for an existing wallet database, use wallet-admin to register the new verifier. Change-Id: I21b72b4373eefc92985aca1505e2d1a1ec699602
2015-12-14Skip Stanford naming policy tests that require NetDBRuss Allbery
We need a fake NetDB server to test this stuff properly, but until then, just avoid running the tests.
2015-11-18Added Wallet::ACL::LDAP::Attribute::RootJon Robertson
Added a version of the LDAP attribute ACL. Like the root version for NetDB, this requires that the principal end in /root, and then strips off /root before doing matching against the given LDAP attribute. Change-Id: I23119ef9c9ce3e0556f5d71a509815f2efc1bbe6
2015-11-18ldap-attr.t: Updated tests to use jonrober rather than rraJon Robertson
Change-Id: I842a7335a4b50c9c20b921ae2efc63aab571635e
2015-11-18stanford.t: Added netdb configuration to policy testsJon Robertson
Since we now check to see if something is a valid netdb node entry for the ACL verifiers, we need to have a valid netdb setup to run. Change-Id: Ic2651f8b8b306dfa1f426d91f329b5100a9a1d64
2015-11-18Added wallet report for nested ACLJon Robertson
We needed a way to report on where all a specific ACL might be nested, since we can't destroy an ACL until it's no longer being nested. For the immediate this is part of wallet-report. Change-Id: I41c11b73325d1eb3a28289eac3505bf965877be1
2015-11-18ACL.pm: Destroying a nested ACL will now failJon Robertson
When destroying an ACL nested in other ACLs, we now fail with an explanation rather than going through to remove all the places it's nested. That's more in line with how we handle trying to destroy ACLs that own things. Change-Id: I8bc0530e37c54369ec52d9b369f8fabe98def77a
2015-06-08Added nested acl verifierJon Robertson
This verifier will allow embedding one ACL in another for more flexible ACL handling. As part of thise we've also added the ability for each verifier to do a syntax check to see if a given name is valid for that verifier. For the moment this returns true for everything but Nested. Nested will check to make sure the given name is an existing group. Change-Id: Iacdf146d46ed882d57b7534058d34db6e6ec1de4
2015-06-08ACL.pm: Error messages use name rather than IDJon Robertson
All error messages should now use the ACL name rather than the ADL id, for readability. Change-Id: I2d1cfe806b459ef083293df4fa0b83cb4cef673b
2015-06-08Merged all Duo objects into one moduleJon Robertson
To handle local proliferation of Duo integration type requests, all Duo types have been merged into one module that will pick up and decide integration specifics off of the object type. If you are using the Duo types locally already, you'll want to load perl/sql/wallet-1.3-update-duo.sql to your database to update the old object types to all use the Duo module. All existing Duo integrations have been added to the module for handling, but nothing new has been added to the wallet object types. Since there are a lot of Duo integrations, sites should only manually add the ones they're interested in to the wallet types table. Change-Id: If9c9a0a3e77923354f31d8f9c98a519c93df200b
2015-06-08wallet-report: Added report of all host-based objects for hostJon Robertson
"wallet-report objects host <hostname>" reports on all objects that belong to the given host. This can be used to query things for retiring systems. Change-Id: Ib1c8e5978fed141d54ecc8504b56b43c037f9b17
2015-06-08Added new method for wallet-backend, updateJon Robertson
update will work generally like get, but only for objects that have a concept of updating content automatically, like keytabs and passwords. For these, the content will be updated before sending to the client. In a later release get for keytabs will be modified to never update the kvno before sending to the user, and so the unchanging flag will be phased out in lieu of explicitly using the method that does what you want. Change-Id: I96a84416c5e50278eb29fe07052dde6e063bc071
2015-06-08Added reports to list all types and acl schemesJon Robertson
Two new reports, 'types' and 'schemes'. These will print out all configured types and acl schemes. Change-Id: Ib06d37755fe80c168a6f723c9a1e683fdf5dfcde
2015-06-08Added a new password object typeJon Robertson
The password type inherits almost everything from the file object, but if you try to get a password object that has never been stored, we generate a random string to put in the object rather than just erroring out. The maximum and minimum length of the string can be set in the wallet config. If a password object was stored earlier and then cleared out, we don't generate another random string. Change-Id: I17a65ca7dac9d4430e8a731f417297890ee612bb
2015-06-08Added acl replace command to wallet backendJon Robertson
New command for replacing the ownership of anything owned by a specific ACL with another ACL. This differs from acl rename in that it's to be used when the destination ACL already exists and potentially already owns some objects. Change-Id: I765bebf499fe0f861abc2ffe1873990590beed36
2014-12-08Update skip count for systems without sqlite3Russ Allbery
Change-Id: I2180daf5055a90ae52b8a851f514993004da5303
2014-10-14Added rename support for file objectsJon Robertson
File objects now support a rename command, which will rename the object and move the file to the right spot in the file store under its new name. Change-Id: I10ea2b8012586d69f0894905cfba54a738f3e418
2014-10-13Added Duo RDP object to the walletJon Robertson
Change-Id: Ic728297fa830ffdd40c1580e32a81f8c5123f66a
2014-10-09Created tests for new Duo object typesJon Robertson
Change-Id: I818be125f3195316b44e650ba6e05b8e0b831ea6
2014-07-16Go back to recording the ADMIN ACL in historyRuss Allbery
This turned out to not be necessary for testing since I was already using sqlite3 to load an unversioned schema. Remove the offending line and restore the old code with some cleanup. Change-Id: I282b6f3b4754e4899222be6366b77a47f0cb7189 Reviewed-on: https://gerrit.stanford.edu/1575 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-16Include the Duo type in the name of Duo integrationsRuss Allbery
Eventually, there will be multiple object types for different Duo integrations, and they will need to have unique names. Add the Duo type in parentheses after the name to help ensure this. Change-Id: I679130f9136077fc6bf5d8c6c9ad98ec83b400d0 Reviewed-on: https://gerrit.stanford.edu/1573 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-16Fix test skip numbering for keytab testsRuss Allbery
Change-Id: I5143d487d6b3623bc2be1724ed766b8709feb506 Reviewed-on: https://gerrit.stanford.edu/1565 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-15Return the name of the ACL instead of the numeric IDRuss Allbery
The owner and getacl commands now return the current name of the ACL instead of its numeric ID, matching the documentation of owner. Change-Id: Ic47aad48bd1454ed4bffff7030b0492d74eee4fa Reviewed-on: https://gerrit.stanford.edu/1559 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-15Record ACL names in the ACL historyRuss Allbery
Change-Id: I0d7a088bb34dda2fc554b9f104c2a33e5faf879e Reviewed-on: https://gerrit.stanford.edu/1554 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-15Record the ACL name in the acl_history tableRuss Allbery
Store the current name of the ACL with each history row, and index the name. This will eventually allow retrieval of history by name for ACLs that have been deleted, although the rest of the code is not yet in place. The initial creation and membership of the ADMIN ACL during database initialization or reinitialization is no longer recorded in the acl_history table, since otherwise it produces errors due to the missing ah_name field when building the database with schema 0.07. There should be some better solution to this, but this will be okay for the time being. Change-Id: I015a00c972e0c2730c3d449952fcfe9b79c6e54f Reviewed-on: https://gerrit.stanford.edu/1553 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-15Drop use POSIX from several tests that don't use itRuss Allbery
Change-Id: I61379e8963569d26c9b9c31d1727f3cca4567f8e Reviewed-on: https://gerrit.stanford.edu/1550 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Test for Perl strict and minimum versionRuss Allbery
Fix strictness issues across the whole code base, and ensure that all Perl scripts enable warnings. (Hopefully enabling warnings won't cause problems for the server.) Change-Id: I4dee49f7a6bcbeeee21d74bf61a1fd26514f832c Reviewed-on: https://gerrit.stanford.edu/1532 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Update Perl POD tests to rra-c-util 5.5Russ Allbery
Now that the Perl directory has been reorganized, it's easier to synchronize with the standard rra-c-util tests. Change-Id: I97a03d06ff964edcc85ab8788af281b7bc321235 Reviewed-on: https://gerrit.stanford.edu/1531 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Switch to Module::Build for the Perl moduleRuss Allbery
The wallet server now requires Perl 5.8 or later (instead of 5.006 in previous versions) and is now built with Module::Build instead of ExtUtils::MakeMaker. This should be transparent to anyone not working with the source code, since Perl 5.8 was released in 2002, but Module::Build is now required to build the wallet server. It is included in some versions of Perl, or can be installed separately from CPAN, distribution packages, or other sources. Also reorganize the test suite to use subdirectories. Change-Id: Id06120ba2bad1ebbfee3d8a48ca2f25869463165 Reviewed-on: https://gerrit.stanford.edu/1530 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Show the error message if verifier-netdb creation failsRuss Allbery
Change-Id: I1acd7894316fc96943b9eda5e3a9abb9d229646c Reviewed-on: https://gerrit.stanford.edu/1528 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Fix test cleanup code to run during global destructionRuss Allbery
If we don't run the code to delete the wallet database very late, destruction of the SQLite objects may recreate the database file. Move the unlink to an END block to avoid this problem. Change-Id: Ib5ec2cbd08ba24c99f3dfa1daa01488931c5958f Reviewed-on: https://gerrit.stanford.edu/1525 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Undo email address change for verifier testRuss Allbery
The global replacement of my email address broke this test as well since I was using my address as part of the test. Revert to the previous email address, since it's just example data. Change-Id: Iaebcf4b4556308d5a69fbe2c8b59b05304dfbf66 Reviewed-on: https://gerrit.stanford.edu/1523 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Fix verifier-netdb test for Heimdal, email addressRuss Allbery
Undo the email address renaming for verifier-netdb as well, since this has to use rra@stanford.edu for right now. Adjust so that the test is not skipped with Heimdal Kerberos user space. Change-Id: I0a0e16e1044fe6057a310cc419477a34052ffcda Reviewed-on: https://gerrit.stanford.edu/1522 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Fix verifier-ldap-attr test from email address changeRuss Allbery
This has to use rra@stanford.edu to work at all (and badly needs some sort of mock LDAP environment rather than what it's doing now). Change-Id: I0961c7f97633eb7e29e391804a6803195564d74b Reviewed-on: https://gerrit.stanford.edu/1521 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Adjust Heimdal keytab object tests to not compare keytabsRuss Allbery
For some reason, two keytabs are comparing inequal even after masking the timestamp but both keytabs work for authentication. Stop doing a data comparison and instead attempt authentications with both keytabs as a more reliable test. Change-Id: I4bd0712d492b78f09e95ffbed3461d97613d9d0a Reviewed-on: https://gerrit.stanford.edu/1520 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Adjust Wallet::Admin test for new schema versionRuss Allbery
We now have a 0.09 schema, so test upgrading from 0.07 to 0.09 in two steps. Change-Id: I0e7af4371ba78aa69a9b7be59239f10c86e1fade Reviewed-on: https://gerrit.stanford.edu/1519 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Adjust ACL test for new SQLite autoincrement behaviorRuss Allbery
Similar to server, the ID of the last ACL created may vary depending on whether SQLite reuses the last autoincrement key when the highest-numbered record is deleted. Accept either possibility. Change-Id: I2dd3b3cbbdf32931820ff799ca06f751c37a4cbd Reviewed-on: https://gerrit.stanford.edu/1518 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Adjust server test for new SQLite autoincrement behaviorRuss Allbery
SQLite now, when the highest-numbered record with an autoincrement key is deleted, will reuse that number instead of incrementing further. Adjust the test suite so that this ambiguity is never encountered, since it's not part of what we're testing. Change-Id: I08c0c1c3fae82556d0f016b95db2992bdded1775 Reviewed-on: https://gerrit.stanford.edu/1517 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-07-11Add new object type for Duo integrationsRuss Allbery
A new object type, duo (Wallet::Object::Duo), is now supported. This creates an integration with the Duo Security cloud multifactor authentication service and allows retrieval of the integration key, secret key, and admin hostname. Currently, only UNIX integration types are supported. The Net::Duo Perl module is required to use this object type. New configuration settings are required as well; see Wallet::Config for more information. To enable this object type for an existing wallet database, use wallet-admin to register the new object. Change-Id: I2c0dac75e81f526b34d6b509c4bdaecb43dd4a9d Reviewed-on: https://gerrit.stanford.edu/1516 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-04-13Change my email address to eagle@eyrie.orgRuss Allbery
Change-Id: I4c2b5d7c807d6c27dd18a3b92eef66d21287d21e Reviewed-on: https://gerrit.stanford.edu/1481 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2014-01-06Fix test skip count in the verifier-ldap-attr testRuss Allbery
When the correct Kerberos tickets aren't available, this test skipped the wrong number of tests. Change-Id: Icf27178fe88027f38764285bb671560e051f9105 Reviewed-on: https://gerrit.stanford.edu/1373 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2013-04-16Improve the keytab enctype test suiteRuss Allbery
Fix recognition of the syntax error from Heimdal's klist -ke, which doesn't exit with status 1. Assume that if we didn't see any known enctypes, we're dealing with Heimdal. Remove the code to populate the enctype table, since we do that in Wallet::Admin now. Show the error if adding an enctype fails. Change-Id: I40da967ef6868e5cd51a1238e1c6324386468134 Reviewed-on: https://gerrit.stanford.edu/1069 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
2013-04-15Allow afs/* principals in the Stanford naming policyRuss Allbery
Change-Id: I59db1e8638a602d9c118ac01da17280c9ed7d005 Reviewed-on: https://gerrit.stanford.edu/1067 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>