class EmbedAuthenticationProperties implements InitializingBean {

    private Map<String, Authentication> authentications = new HashMap<>();

    @Getter
    @Setter
    private Map<String, EmbedAuthenticationInfo> users = new HashMap<>();

    @Autowired(required = false)
    private DataAccessConfigBuilderFactory dataAccessConfigBuilderFactory = new SimpleDataAccessConfigBuilderFactory();

    @Override
    public void afterPropertiesSet() {<FILL_FUNCTION_BODY>}

    public Authentication authenticate(AuthenticationRequest request) {
        if (MapUtils.isEmpty(users)) {
            return null;
        }
        if (request instanceof PlainTextUsernamePasswordAuthenticationRequest) {
            PlainTextUsernamePasswordAuthenticationRequest pwdReq = ((PlainTextUsernamePasswordAuthenticationRequest) request);
            for (EmbedAuthenticationInfo user : users.values()) {
                if (pwdReq.getUsername().equals(user.getUsername())) {
                    if (pwdReq.getPassword().equals(user.getPassword())) {
                        return user.toAuthentication(dataAccessConfigBuilderFactory);
                    }
                    return null;
                }
            }
            return null;
        }

        throw new UnsupportedOperationException("不支持的授权请求:" + request);
    }

    public Optional<Authentication> getAuthentication(String userId) {
        return Optional.ofNullable(authentications.get(userId));
    }


}

        users.forEach((id, properties) -> {
            if (StringUtils.isEmpty(properties.getId())) {
                properties.setId(id);
            }
            for (EmbedAuthenticationInfo.PermissionInfo permissionInfo : properties.getPermissions()) {
                for (Map<String, Object> objectMap : permissionInfo.getDataAccesses()) {
                    for (Map.Entry<String, Object> stringObjectEntry : objectMap.entrySet()) {
                        if (stringObjectEntry.getValue() instanceof Map) {
                            Map<?, ?> mapVal = ((Map) stringObjectEntry.getValue());
                            boolean maybeIsList = mapVal
                                    .keySet()
                                    .stream()
                                    .allMatch(org.hswebframework.utils.StringUtils::isInt);
                            if (maybeIsList) {
                                stringObjectEntry.setValue(mapVal.values());
                            }
                        }
                    }
                }
            }
            authentications.put(id, properties.toAuthentication(dataAccessConfigBuilderFactory));
        });
    
<no_super_class>