docs: public static Map<String, ?> toDataMap(final AuthRequest authRequest) {
          HashMap<String, Object> stringHashMap = new HashMap<>();
          //context
          Map<String, Object> ruleMap = new HashMap<>();
          if (authRequest.environment.equals(createAppEnv())) {
              //app context
              HashMap<String, String> s = new HashMap<>();
              s.put("application", "rundeck");
              stringHashMap.put(CONTEXT_LONG_OPT, s);
          } else {
              String project = authRequest.environment.iterator().next().value;
              HashMap<String, String> s = new HashMap<>();
              s.put("project", project);
              stringHashMap.put(CONTEXT_LONG_OPT, s);
          }
  
          //subject
          Set<Username> principals = authRequest.subject.getPrincipals(Username.class);
          if (principals.iterator().next().getName().equals("user")) {
              //use groups
              HashMap<String, Object> s = new HashMap<>();
              ArrayList<String> strings = new ArrayList<>();
              for (Group group : authRequest.subject.getPrincipals(Group.class)) {
                  strings.add(group.getName());
              }
              s.put("group", strings.size() > 1 ? strings : strings.iterator().next());
              stringHashMap.put("by", s);
          } else {
              HashMap<String, String> s = new HashMap<>();
              s.put("username", principals.iterator().next().getName());
              stringHashMap.put("by", s);
          }
  
          Map<String, Object> resource = new HashMap<>();
          //resource
          String type = authRequest.resourceMap.get("type").toString();
          resource.putAll(authRequest.resourceMap);
          resource.remove("type");
  
          //project context type
          HashMap<String, Object> s = new HashMap<>();
          ArrayList<Map<String, Object>> maps = new ArrayList<>();
          s.put(type, maps);
          HashMap<String, Object> r = new HashMap<>();
          if (resource.size() > 0) {
              r.put(authRequest.regexMatch ? "match" : authRequest.containsMatch ? "contains" : "equals", resource);
          }
          if (authRequest.actions != null && authRequest.actions.size() > 0) {
  
              r.put(
                      "allow",
                      authRequest.actions.size() > 1
                      ? new ArrayList<>(authRequest.actions)
                      : authRequest.actions.iterator().next()
              );
          }
          if (authRequest.denyActions != null && authRequest.denyActions.size() > 0) {
              r.put(
                      "deny",
                      authRequest.denyActions.size() > 1
                      ? new ArrayList<>(authRequest.denyActions)
                      : authRequest.denyActions.iterator().next()
              );
          }
          maps.add(r);
          ruleMap.putAll(s);
  
          stringHashMap.put("for", ruleMap);
          stringHashMap.put("description", authRequest.description != null ? authRequest.description : "generated");
  
  
          return stringHashMap;
      }