Skip to content

Commit

Permalink
chore: revert back to nucleus trie
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosentino11 committed Feb 2, 2024
1 parent 270080f commit 283fc94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 352 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

package com.aws.greengrass.clientdevices.auth;

import com.aws.greengrass.authorization.WildcardTrie;
import com.aws.greengrass.clientdevices.auth.configuration.GroupManager;
import com.aws.greengrass.clientdevices.auth.configuration.Permission;
import com.aws.greengrass.clientdevices.auth.exception.PolicyException;
import com.aws.greengrass.clientdevices.auth.session.Session;
import com.aws.greengrass.clientdevices.auth.util.WildcardTrie;
import com.aws.greengrass.logging.api.Logger;
import com.aws.greengrass.logging.impl.LogManager;
import com.aws.greengrass.util.Utils;
Expand Down Expand Up @@ -37,7 +37,6 @@ public final class PermissionEvaluationUtils {
private static final Pattern SERVICE_RESOURCE_PATTERN = Pattern.compile(
String.format(SERVICE_RESOURCE_FORMAT, SERVICE_PATTERN_STRING, SERVICE_RESOURCE_TYPE_PATTERN_STRING,
SERVICE_RESOURCE_NAME_PATTERN_STRING), Pattern.UNICODE_CHARACTER_CLASS);
private final WildcardTrie wildcardTrie = new WildcardTrie();
private final GroupManager groupManager;

/**
Expand Down Expand Up @@ -132,7 +131,8 @@ private boolean compareResource(Resource requestResource, String policyResource)
return true;
}

wildcardTrie.set(policyResource);
WildcardTrie wildcardTrie = new WildcardTrie();
wildcardTrie.add(policyResource);
return wildcardTrie.matchesStandard(requestResource.getResourceStr());
}

Expand Down

This file was deleted.

0 comments on commit 283fc94

Please sign in to comment.