public static AllowList read(final String file) throws Exception {
        final InputStream stream = new FileInputStream(new File(file));

        final LoaderOptions options = new LoaderOptions();
        final Constructor constructor = new Constructor(AllowList.class, options);
        final TypeDescription allowListDescription = new TypeDescription(AllowList.class);
        allowListDescription.addPropertyParameters("grants", String.class, Object.class);
        allowListDescription.addPropertyParameters("groups", String.class, Object.class);
        constructor.addTypeDescription(allowListDescription);

        final Yaml yaml = new Yaml(constructor);
        return yaml.loadAs(stream, AllowList.class);
    }
Read a configuration from a YAML file into an {@link AllowList} object.

@param file the location of a AllowList YAML configuration file
@return An {@link Optional} object wrapping the created {@link AllowList}
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/authz/AllowList.java