[ 
https://issues.apache.org/jira/browse/TINKERPOP-3282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18120709#comment-18120709
 ] 

ASF GitHub Bot commented on TINKERPOP-3282:
-------------------------------------------

spmallette commented on code in PR #3639:
URL: https://github.com/apache/tinkerpop/pull/3639#discussion_r4132806721


##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/auth/SimpleAuthenticator.java:
##########
@@ -80,12 +83,63 @@ public void setup(final Map<String,Object> config) {
             // have to create the indices because they are not stored in gryo
             final TinkerGraph tinkerGraph = (TinkerGraph) graph;
             tinkerGraph.createIndex(PROPERTY_USERNAME, Vertex.class);
+
+            // TinkerGraph no longer auto-loads from graphLocation on open, so 
read the credential store here from
+            // the configured location/format. TinkerStorageGraph (which 
persists via its own storage engine) manages
+            // its own data and is left untouched.
+            loadCredentialStore(tinkerGraph);
         }
 
         credentialStore = graph.traversal(CredentialTraversalSource.class);
         logger.info("CredentialGraph initialized at {}", credentialStore);
     }
 
+    /**
+     * Reads the credential store into the supplied in-memory {@link 
TinkerGraph} from the
+     * {@code gremlin.tinkergraph.graphLocation} and {@code 
gremlin.tinkergraph.graphFormat} entries of its
+     * configuration, if present. Earlier versions of TinkerGraph read those 
keys themselves on open, so the
+     * credential store loaded as a side effect of {@code GraphFactory.open}; 
that automatic behaviour was removed
+     * and this method preserves it for the credential store alone.
+     * <p/>
+     * No TinkerGraph reads either key any more, which is why they are named 
here as literals rather than through
+     * constants. Despite the {@code gremlin.tinkergraph} prefix they are in 
effect settings of this authenticator,
+     * and belong in its own {@code config} block beside {@code credentialsDb} 
rather than in the graph's properties
+     * file. They are left in place here only to keep existing credential 
configurations working. A graph with a
+     * storage engine manages its own data and is skipped.
+     */
+    private static void loadCredentialStore(final TinkerGraph graph) {

Review Comment:
   yeah.........i noticed that and figured we'd be coming for that issue 
someday, so i just left the settings as they were.





> TinkerGraph file persistence
> ----------------------------
>
>                 Key: TINKERPOP-3282
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3282
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: tinkergraph
>    Affects Versions: 3.7.6
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Major
>
> Give TinkerGraph a basic file persistence option tied to its transactional 
> usage so that it can support some more complex use cases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to