mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 01:36:39 +00:00
dont fingerprint machine clients
This commit is contained in:
@@ -294,9 +294,11 @@ export async function getClient(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isUserDevice = client.user !== null && client.user !== undefined;
|
||||||
|
|
||||||
// Replace name with device name if OLM exists
|
// Replace name with device name if OLM exists
|
||||||
let clientName = client.clients.name;
|
let clientName = client.clients.name;
|
||||||
if (client.olms) {
|
if (client.olms && isUserDevice) {
|
||||||
const model = client.currentFingerprint?.deviceModel || null;
|
const model = client.currentFingerprint?.deviceModel || null;
|
||||||
clientName = getUserDeviceName(model, client.clients.name);
|
clientName = getUserDeviceName(model, client.clients.name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,7 +320,10 @@ export async function listClients(
|
|||||||
// Merge clients with their site associations and replace name with device name
|
// Merge clients with their site associations and replace name with device name
|
||||||
const clientsWithSites = clientsList.map((client) => {
|
const clientsWithSites = clientsList.map((client) => {
|
||||||
const model = client.deviceModel || null;
|
const model = client.deviceModel || null;
|
||||||
const newName = getUserDeviceName(model, client.name);
|
let newName = client.name;
|
||||||
|
if (filter === "user") {
|
||||||
|
newName = getUserDeviceName(model, client.name);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...client,
|
...client,
|
||||||
name: newName,
|
name: newName,
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ export const handleOlmPingMessage: MessageHandler = async (context) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isUserDevice = olm.userId !== null && olm.userId !== undefined;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// get the client
|
// get the client
|
||||||
const [client] = await db
|
const [client] = await db
|
||||||
@@ -219,7 +221,9 @@ export const handleOlmPingMessage: MessageHandler = async (context) => {
|
|||||||
logger.error("Error handling ping message", { error });
|
logger.error("Error handling ping message", { error });
|
||||||
}
|
}
|
||||||
|
|
||||||
await handleFingerprintInsertion(olm, fingerprint, postures);
|
if (isUserDevice) {
|
||||||
|
await handleFingerprintInsertion(olm, fingerprint, postures);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
message: {
|
message: {
|
||||||
|
|||||||
@@ -53,7 +53,11 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
|||||||
postures
|
postures
|
||||||
});
|
});
|
||||||
|
|
||||||
await handleFingerprintInsertion(olm, fingerprint, postures);
|
const isUserDevice = olm.userId !== null && olm.userId !== undefined;
|
||||||
|
|
||||||
|
if (isUserDevice) {
|
||||||
|
await handleFingerprintInsertion(olm, fingerprint, postures);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(olmVersion && olm.version !== olmVersion) ||
|
(olmVersion && olm.version !== olmVersion) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user