public static SecretIdentifier fromExternalForm(String urn) {
        if (urn == null || !urnPattern.matcher(urn).matches()) {
            throw new IllegalArgumentException("Invalid external form " + urn);
        }
        String[] parts = colonPattern.split(urn, 5);
        return new SecretIdentifier(validateWithTransform(parts[4], "key"));
    }
@Test
    public void testFromExternal() {
        assertThat(SecretIdentifier.fromExternalForm("urn:logstash:secret:v1:foo")).isEqualTo(new SecretIdentifier("foo"));
        assertThat(SecretIdentifier.fromExternalForm("urn:logstash:secret:v1:foo:bar")).isEqualTo(new SecretIdentifier("foo:bar"));
    }