Commit graph

20 commits

Author SHA1 Message Date
Firstyear bf1e9b0989
Make schema indexing a boolean instead of index types ()
Previously on schema definitions for attributes, the list of index
types was manually set on attributes. The issue with this approach is
that not all index types apply to all attribute syntaxes. This made it
error prone not just to Kanidm developers, but to future users who
want to define custom attributes and may incorrectly index those
attributes.

Instead, this changes the index value to be a boolean to indicate
if this attribute should or should not be indexed. Internally Kanidm
has a list of appropriate indexes to apply to these syntax types.

As part of this change, the tests were reviewed to find missing index
types for syntaxes, and other causes of unindexed searches which led
to some changes around the dyngroup plugin (which pushes the boundaries
of a lot of things in Kani due to how it works).
2025-03-21 02:13:54 +00:00
Firstyear 9b3350f753
Cleanup of println and other outputs () 2024-12-04 15:13:14 +10:00
James Hodgkinson 3eae7be0bb
OAuth2 Token Type ()
* fix(OAuth2): Invalid `token_type` for token introspection
Fixes 

* fix(aut): `assert_eq` instead of `assert ==`

* fix(OAuth2): IANA registry access token types

* fix(OAuth2): deserialize case insensitively
2024-08-25 23:30:20 +00:00
Firstyear 3ae8453375
In honour of SebaT, error on db lock acq timeout () 2024-08-02 09:29:46 +10:00
Alin Trăistaru 562f352516
fix typos ()
* fix typos and misspellings
* use proper capitalization
* Apply suggestions from code review
---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-07-18 03:22:20 +00:00
Firstyear 10ad183732
[SECURITY: LOW] Administrator triggered thread crash in oauth2 claim maps ()
When an admin configured oauth2 custom claims during the creation it
was not enforced that at least one value must be present. This led to
an incorrect logic flaw in str_concat! which didn't handle the 0 case.

This hardens str_concat! to prevent the thread crash by using itertools
for the join instead, and it enforces stricter validation on the valueset
to deny creation of empty claims.

This fix has a low security impact as only an administrator or high
level user can trigger this as a possible denial of service.

Fixes  Fixes 
2024-03-26 01:43:03 +00:00
Firstyear 3760951b6d
Add domain version test framework ()
Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2024-02-28 21:04:33 +00:00
James Hodgkinson 4efdb7208f
of course I started looking at clippy things and now I can't stop () 2024-02-21 00:52:10 +00:00
Firstyear 23cc2e7745
Fix RUV trim ()
Fixes two major issues with replication.

The first was related to server refreshes. When a server was refreshed it would retain it's server unique id. If the server had lagged and was disconnected from replication and administrator would naturally then refresh it's database. This meant that on next tombstone purge of the server, it's RUV would jump ahead causing it's refresh-supplier to now believe it was lagging (which was not the case).

In the situation where a server is refreshed, we reset the servers unique replication ID which avoids the RUV having "jumps".

The second issue was related to RUV trimming. A server which had older RUV entries (say from servers that have been trimmed) would "taint" and re-supply those server ID's back to nodes that wanted to trim them. This also meant that on a restart of the server, that if the node had correctly trimmed the server ID, it would be re-added in memory.

This improves RUV trimming by limiting what what compare and check as a supplier to only CID's that are within the valid changelog window. This itself presented challenges with "how to determine if a server should be removed from the RUV". To achieve this we now check for "overlap" of the RUVS. If overlap isn't occurring it indicates split brain or node isolation, and replication is stopped in these cases.
2024-02-02 15:38:45 +10:00
Firstyear 8dc884f38e
2390 1980 allow native applications () 2024-01-16 10:44:12 +10:00
James Hodgkinson d9da1eeca0
Chasing yaks down dark alleyways ()
* adding some test coverage because there was some rando panic-inducing thing
* ldap constants
* documenting a macro
* helpful weird errors
* the war on strings continues
* less json more better
* testing things fixing bugs
* idm_domain_reset_token_key wasn't working, added a test and fixed it (we weren't testing it)
* idm_domain_set_ldap_basedn - adding tests
* adding testing for idm_account_credential_update_cancel_mfareg
* warning of deprecation
2023-10-11 15:44:29 +10:00
Firstyear a91bf55471
20231008 remove expect used ()
* Stop using expect on some tasks
2023-10-08 17:39:00 +10:00
James Hodgkinson d5ed335b52
Cinco de yakko ()
* there are always more yaks
* see? ldap yaks.
* fixing stupid radius container build thing
2023-09-16 12:11:06 +10:00
Firstyear 77da40d528
68 20230912 session consistency ()
This adds support for special-casing sessions in replication to allow them to internally trim and merge so that session revocations and creations are not lost between replicas.
2023-09-16 09:22:11 +10:00
James Hodgkinson d3d80e7364
Schema-dooby-doo-part-trois ()
* adding extra_attributes field to BuiltinGroup, migrating more things.
* checkpoint 3 - ACP, easy as 1,2,3
* codespell
* now throwing error on dyngroup with defined members
2023-09-09 09:38:47 +10:00
James Hodgkinson 05b35df413
Less human strings more enums ()
* statics or enums you choose
* acp rewrite, defined SchemaAcp as a test
* macros and targetscopes and filters oh my
2023-08-21 17:16:43 +10:00
Firstyear d731b20a9d
20230728 techdebt paydown () 2023-07-31 12:20:52 +10:00
Firstyear 4718f2dc6b
1115 priv (reauth, sudo) mode () 2023-03-27 11:38:09 +10:00
Firstyear 0e57b6f914
1399 some async cleanup ()
* More cleanerer
* More async!
* Fix up tests
2023-03-03 17:53:54 +10:00
Firstyear 00cca81012
1399 cleanup reorg () 2023-03-01 13:10:52 +10:00
Renamed from kanidmd/lib/src/macros.rs (Browse further)