Skip to content

A free open source IT asset/license management system

Updated help text for Jamf Pro

snipe6e649903bd51
diff --git a/resources/lang/en-US/admin/settings/sync_adapters.php b/resources/lang/en-US/admin/settings/sync_adapters.php
index c589547180..b486cac15d 100644
--- a/resources/lang/en-US/admin/settings/sync_adapters.php
+++ b/resources/lang/en-US/admin/settings/sync_adapters.php
@@ -150,7 +150,8 @@ return [
'fleet_token_help' => 'Generate under My Account -> Get API token in your Fleet instance. Needs an admin or observer role with read access to hosts (and to teams if you use group-to-company mapping).',
'kandji_token_help' => 'Generate under Settings -> Access -> API Token in your Iru (Kandji) tenant. Needs the Device list read permission (and Blueprint list if you use group-to-company mapping).',
'kandji_base_url_help' => 'Your Iru (Kandji) API URL is listed on the Access page of your Iru (Kandji) admin console under the API Token section. It is not the same as the URL you use to sign into the admin console. Save the URL that ends with <code>.api.kandji.io</code>, not the dashboard URL.',
- 'jamf_token_help' => 'Generate a Personal Access Token under Settings -> System -> API Roles and Clients in Jamf Pro. The role needs Read on Computers (and Sites if you use group-to-company mapping).',
+ 'jamf_client_id_help' => 'Create an API Role granting Read on Computers (and Read on Sites if you use group-to-company mapping), then an API Client that uses that role, under Settings -> System -> API Roles and Clients in Jamf Pro. Copy the Client ID from the API Client detail page. The token lifetime is configurable per API Client in Jamf. Snipe-IT caches the token for the full sync run and re-exchanges automatically before it expires, so any reasonable lifetime works.',
+ 'jamf_client_secret_help' => 'Paired with the Client ID above. Jamf Pro shows the secret once at API Client creation time.',
'jamf_school_network_id_help' => 'Find your Network ID under Organization -> Settings -> API in the Jamf School admin console.',
'jamf_school_api_key_help' => 'Generate under Organization -> Settings -> API in Jamf School. Needs read access to Devices (and Locations if you use group-to-company mapping).',
'jumpcloud_token_help' => 'Copy from your JumpCloud admin user\'s profile page (top-right menu -> My API Key). API keys inherit the admin user\'s permissions, so use an account with read access to Systems.',
diff --git a/tests/Feature/SyncAdapters/AssetTagPatternTest.php b/tests/Feature/SyncAdapters/AssetTagPatternTest.php
index 4a6eb741a6..72b012df51 100644
--- a/tests/Feature/SyncAdapters/AssetTagPatternTest.php
+++ b/tests/Feature/SyncAdapters/AssetTagPatternTest.php
@@ -111,6 +111,33 @@ class AssetTagPatternTest extends TestCase
]);
}
+ public function test_whitespace_only_vendor_asset_tag_falls_through_to_synthetic_tag()
+ {
+ // Regression pin: a Jamf (or any adapter) record carrying a
+ // single-space asset_tag used to pass the "non-empty" guard
+ // in SyncsHostFromRecord::applyNativeFieldWrite, overwrite the
+ // resolveAssetTag fallback, and then fail asset validation
+ // because asset_tag can't be blank. The record never synced.
+ // Trimming before the empty check lets whitespace-only values
+ // fall back to the synthetic `{source}-{sourceId}` tag like
+ // null and '' already did.
+ $this->configuredFleet();
+
+ SyncAdapter::syncFromRecord(new HostInventoryRecord(
+ sourceKey: 'fleet',
+ sourceId: 'ws-only',
+ hostname: 'wksn-whitespace',
+ hardwareSerial: 'SN-WS',
+ hardwareModel: 'MacBook Pro',
+ assetTag: ' ',
+ ));
+
+ $this->assertDatabaseHas('assets', [
+ 'name' => 'wksn-whitespace',
+ 'asset_tag' => 'fleet-ws-only',
+ ]);
+ }
+
public function test_pattern_does_not_retag_existing_asset_on_update_sync()
{
$fleet = $this->configuredFleet();