Skip to content

Rc/3.0.0#50

Open
martinzigrai wants to merge 25 commits into
mainfrom
rc/2.6.0
Open

Rc/3.0.0#50
martinzigrai wants to merge 25 commits into
mainfrom
rc/2.6.0

Conversation

@martinzigrai
Copy link
Copy Markdown
Contributor

No description provided.

val scopeType = ScopeType.valueOf(getString("scanScope"))
val trustedInstallSources = optJSONArray("trustedInstallSources")
?.toPrimitiveArray<String>()?.toList()
?: emptyList()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not consistent with other platforms, which use null as fallback. Can we do the same here?

val malwareScanScope = getJSONObject("malwareScanScope").toMalwareScanScope()
val reasonMode = ReasonMode.valueOf(getString("reasonMode"))
return SuspiciousAppDetectionConfig(
if (has("packageNames")) getArraySafe("packageNames").toSet() else null,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty array results to emptySet(), whereas other platforms result in null. Can you make it consistent pls?

Comment thread src/api/methods/capacitor.ts Outdated
};
};

const normalizeConfig = (config: TalsecConfig): TalsecConfig => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method adds default args. The name does not reflect this properly. Maybe can we name it withDefaults? (applies to all platforms)

Comment thread src/api/methods/capacitor.ts Outdated
Comment on lines +19 to +35
const withSuspiciousAppDetectionDefaults = (config: SuspiciousAppDetectionConfig): SuspiciousAppDetectionConfig => ({
...config,
malwareScanScope: config.malwareScanScope ?? DEFAULT_MALWARE_SCAN_SCOPE,
reasonMode: config.reasonMode ?? DEFAULT_REASON_MODE,
});

const normalizeAndroidConfig = (androidConfig: TalsecAndroidConfig): TalsecAndroidConfig => {
if (!androidConfig.suspiciousAppDetectionConfig) {
return androidConfig;
}
return {
...androidConfig,
suspiciousAppDetectionConfig: withSuspiciousAppDetectionDefaults(androidConfig.suspiciousAppDetectionConfig),
};
};

const normalizeConfig = (config: TalsecConfig): TalsecConfig => {
Copy link
Copy Markdown
Member

@tompsota tompsota May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods should not be part of the API, maybe could we move them to utils? (applies to all platforms)

@martinzigrai martinzigrai changed the title Rc/2.6.0 Rc/3.0.0 May 19, 2026
Comment thread src/utils/config.ts Outdated
martinzigrai and others added 4 commits May 27, 2026 16:14
Rename the `scanScope: ScopeType` field inside the `ScanScope` type to
`scopeType` so the field name matches its type name. Update the JSON key,
default config, example app, Kotlin native bridge, and dist files accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tompsota tompsota added the release Create release after merging this PR label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Create release after merging this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants