Safetorun/safe_to_run

Intent verifier - shouldn't have a .addConfiguration() function

dllewellyn opened this issue · 0 comments

Currently to add a URL Configuration, you have to do this:

val extraIntent = intent.getParcelableExtra<Intent>("extra_intent")
        extraIntent?.verify(this) {

            urlConfiguration {
                "insecureapp.com".allowHost()
            }.addConfiguration()

            actionOnSuccess = {
                startActivity(extraIntent)
                finish()
            }

            actionOnFailure = {
                throw RuntimeException("Please don't hack my app")
            }
        }

Instead, it should just be added automatically by adding a URL configuration function to the builder. e.g. it should look like this:

  extraIntent?.verify(this) {

            urlConfiguration {
                "insecureapp.com".allowHost()
            } 
}