Skip to content

Conversation

@anestos
Copy link

@anestos anestos commented Nov 18, 2025

I m boostraping the mtls client authentication. I guess we need to match the types expected by the SDK somehow:

    /**
     * Mutual Transport Layer Security (MTLS) authentication method.
     *
     * @property clientKeyStore The client KeyStore.
     * @property clientKeyStorePassword The password for the clientKeyStore.
     * @property serverTrustStore The server TrustStore.
     */
        val clientKeyStore: @RawValue KeyStore,
        val clientKeyStorePassword: CharArray,
        val serverTrustStore: @RawValue KeyStore
     

@daniellindau any ideas how to do that?

Copilot finished reviewing on behalf of anestos November 18, 2025 16:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for mTLS (mutual TLS) authentication for Dynamic Client Registration (DCR) fallback functionality, and upgrades both the iOS and Android HAAPI SDK dependencies to version 5.0.0.

Key changes:

  • Updates HAAPI SDK from 4.x to 5.0.0 for both iOS (4.3.0 → 5.0.0) and Android (4.2.1 → 5.0.0)
  • Adds mTLS client authentication option for fallback registration on Android as an alternative to client secret
  • Documents new mTLS-related configuration parameters (client_authentication_mtls, mtls_client_keystore, mtls_client_keystore_password, mtls_server_truststore)

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
react-native-haapi-module.podspec Updates iOS HAAPI SDK dependency to version 5.0.0
android/build.gradle Updates Android HAAPI SDK dependency to version 5.0.0
android/src/main/java/io/curity/haapi/react/HaapiConfigurationUtil.kt Implements mTLS client authentication support for DCR fallback with conditional logic to choose between mTLS and secret-based authentication
README.md Documents new mTLS configuration parameters and reformats existing documentation tables for better readability

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

val registrationEndpoint = asOptionalUri(conf, "registrationEndpointUri") ?: return
val fallbackTemplate = asStringOrThrow(conf, "fallback_template_id")
val registrationClientSecret = asStringOrThrow(conf, "registration_secret")
val clientAuthenticationMethod
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Variable declaration is missing initialization. The variable clientAuthenticationMethod must be initialized or use an explicit type annotation. Consider using:

val clientAuthenticationMethod: ClientAuthenticationMethodConfiguration

or initialize it inline with an if expression:

val clientAuthenticationMethod = if (conf["client_authentication_mtls"] as? Boolean? ?: false) {
    // ...
} else {
    // ...
}
Suggested change
val clientAuthenticationMethod
val clientAuthenticationMethod: ClientAuthenticationMethodConfiguration

Copilot uses AI. Check for mistakes.
README.md Outdated
`mtls_client_keystore` | android | false | | The client KeyStore
`mtls_client_keystore_password` | android | false | | The password for the clientKeyStore.
`mtls_server_truststore` | android | false | | The server TrustStore
`registration_secret` | android | false | | Name of the template client to be used in fallback. Required if fallback registration should be used.
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Duplicate parameter entry. The parameter registration_secret is already documented on line 28. This duplicate entry on line 33 should be removed.

Suggested change
`registration_secret` | android | false | | Name of the template client to be used in fallback. Required if fallback registration should be used.

Copilot uses AI. Check for mistakes.
@anestos anestos marked this pull request as draft November 18, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants