File size: 14,963 Bytes
6f80ef7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | dataset_index,text,true_label,predicted_label,correct,error_type,probability_audit_accountability,probability_unrelated
8,"public CamelWebSocketHandler() { this.receiveListener = new UndertowReceiveListener(); this.callback = new UndertowWebSocketConnectionCallback(); this.closeListener = (WebSocketChannel channel) -> sendEventNotificationIfNeeded( (String) channel.getAttribute(UndertowConstants.CONNECTION_KEY), null, channel, EventType.ONCLOSE); this.delegate = Handlers.websocket(callback); }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9726507663726807,0.027349282056093216
17,"@Override public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel) { LOG.trace(""onConnect {}"", exchange); OAuthTokenValidationResult oauthTokenValidationResult = exchange.getAttachment(OAUTH_TOKEN_VALIDATION_RESULT_ATTACHMENT); if (oauthTokenValidationResult == null && requiresOAuth()) { LOG.warn(""Closing WebSocket channel whose handshake was not OAuth validated""); WebSockets.sendClose(CloseMessage.MSG_VIOLATES_POLICY, ""Authentication required"", channel, null); return; } final String connectionKey = UUID.randomUUID().toString(); channel.setAttribute(UndertowConstants.CONNECTION_KEY, connectionKey); if (oauthTokenValidationResult != null) { channel.setAttribute(OAuthHttpSecuritySupport.OAUTH_TOKEN_VALIDATION_RESULT, oauthTokenValidationResult); } channel.getReceiveSetter().set(receiveListener); channel.addCloseTask(closeListener); sendEventNotificationIfNeeded(connectionKey, exchange, channel, EventType.ONOPEN); channel.resumeReceives(); }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9900937676429749,0.009906197898089886
22,"@Query(""SELECT a FROM AuditLogEntity a WHERE "" + ""a.tenantId = :tenantId "" + ""AND (:startTime IS NULL OR a.createdTime >= :startTime) "" + ""AND (:endTime IS NULL OR a.createdTime <= :endTime) "" + ""AND ((:actionTypes) IS NULL OR a.actionType IN (:actionTypes)) "" + ""AND (:textSearch IS NULL OR ilike(a.entityType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.entityName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.userName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionStatus, CONCAT('%', :textSearch, '%')) = true)"" ) Page<AuditLogEntity> findByTenantId( @Param(""tenantId"") UUID tenantId, @Param(""textSearch"") String textSearch, @Param(""startTime"") Long startTime, @Param(""endTime"") Long endTime, @Param(""actionTypes"") List<ActionType> actionTypes, Pageable pageable);",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.16915641725063324,0.8308435678482056
24,final FlowChangeAction processorAction = createFlowChangeAction(); processorAction.setSourceId(processor.getIdentifier()); processorAction.setSourceName(processor.getName()); processorAction.setSourceType(Component.Processor); processorAction.setComponentDetails(processorDetails); processorAction.setOperation(ScheduledState.RUNNING.equals(processor.getScheduledState()) ? Operation.Start : Operation.Stop); actions.add(processorAction);,audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.0008172939415089786,0.9991826415061951
28,"@Query(""SELECT a FROM AuditLogEntity a WHERE "" + ""a.tenantId = :tenantId "" + ""AND a.userId = :userId "" + ""AND (:startTime IS NULL OR a.createdTime >= :startTime) "" + ""AND (:endTime IS NULL OR a.createdTime <= :endTime) "" + ""AND ((:actionTypes) IS NULL OR a.actionType IN (:actionTypes)) "" + ""AND (:textSearch IS NULL OR ilike(a.entityType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.entityName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionStatus, CONCAT('%', :textSearch, '%')) = true)"" ) Page<AuditLogEntity> findAuditLogsByTenantIdAndUserId(@Param(""tenantId"") UUID tenantId, @Param(""userId"") UUID userId, @Param(""textSearch"") String textSearch, @Param(""startTime"") Long startTime, @Param(""endTime"") Long endTime, @Param(""actionTypes"") List<ActionType> actionTypes, Pageable pageable);",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.3596550524234772,0.6403449177742004
30,"public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) { try { getBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME, beanFactory); } catch (NoSuchBeanDefinitionException o_O) { throw new IllegalStateException( ""Invalid auditing setup; Make sure you've used @EnableJpaAuditing or <jpa:auditing /> correctly"", o_O); } for (String beanName : getEntityManagerFactoryBeanNames(beanFactory)) { BeanDefinition definition = getBeanDefinition(beanName, beanFactory); definition.setDependsOn(addStringToArray(definition.getDependsOn(), BEAN_CONFIGURER_ASPECT_BEAN_NAME)); } }",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.0007471139542758465,0.9992528557777405
43,"public DedicatedJpaAuditLogDao(AuditLogRepository auditLogRepository, DedicatedEventsSqlPartitioningRepository partitioningRepository) { super(auditLogRepository, partitioningRepository); }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9897404909133911,0.010259446687996387
46,"@Query(""SELECT a FROM AuditLogEntity a WHERE "" + ""a.tenantId = :tenantId "" + ""AND a.customerId = :customerId "" + ""AND (:startTime IS NULL OR a.createdTime >= :startTime) "" + ""AND (:endTime IS NULL OR a.createdTime <= :endTime) "" + ""AND ((:actionTypes) IS NULL OR a.actionType IN (:actionTypes)) "" + ""AND (:textSearch IS NULL OR ilike(a.entityType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.entityName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.userName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionStatus, CONCAT('%', :textSearch, '%')) = true)"" ) Page<AuditLogEntity> findAuditLogsByTenantIdAndCustomerId(@Param(""tenantId"") UUID tenantId, @Param(""customerId"") UUID customerId, @Param(""textSearch"") String textSearch, @Param(""startTime"") Long startTime, @Param(""endTime"") Long endTime, @Param(""actionTypes"") List<ActionType> actionTypes, Pageable pageable);",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.13454431295394897,0.8654556274414062
49,"@Query(""SELECT a FROM AuditLogEntity a WHERE "" + ""a.tenantId = :tenantId "" + ""AND a.entityType = :entityType AND a.entityId = :entityId "" + ""AND (:startTime IS NULL OR a.createdTime >= :startTime) "" + ""AND (:endTime IS NULL OR a.createdTime <= :endTime) "" + ""AND ((:actionTypes) IS NULL OR a.actionType IN (:actionTypes)) "" + ""AND (:textSearch IS NULL OR ilike(a.entityName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.userName, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionType, CONCAT('%', :textSearch, '%')) = true "" + ""OR ilike(a.actionStatus, CONCAT('%', :textSearch, '%')) = true)"" ) Page<AuditLogEntity> findAuditLogsByTenantIdAndEntityId(@Param(""tenantId"") UUID tenantId, @Param(""entityType"") EntityType entityType, @Param(""entityId"") UUID entityId, @Param(""textSearch"") String textSearch, @Param(""startTime"") Long startTime, @Param(""endTime"") Long endTime, @Param(""actionTypes"") List<ActionType> actionTypes, Pageable pageable);",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.037442974746227264,0.9625569581985474
54,"@Override protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition, BeanDefinitionRegistry registry) { if (!registry.containsBeanDefinition(JPA_MAPPING_CONTEXT_BEAN_NAME)) { registry.registerBeanDefinition(JPA_MAPPING_CONTEXT_BEAN_NAME, new RootBeanDefinition(JpaMetamodelMappingContextFactoryBean.class)); } BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(AuditingEntityListener.class); builder.addPropertyValue(""auditingHandler"", ParsingUtils.getObjectFactoryBeanDefinition(getAuditingHandlerBeanName(), null)); registerInfrastructureBeanWithId(builder.getRawBeanDefinition(), AuditingEntityListener.class.getName(), registry); }",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.000740239629521966,0.9992597699165344
60,"@EventListener(classes = UserAuthDataChangedEvent.class) public void onUserAuthDataChanged(UserAuthDataChangedEvent event) { if (StringUtils.hasText(event.getId())) { cache.put(event.getId(), event.getTs()); } }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9963765740394592,0.003623413620516658
61,"@ApiOperation(value = ""Enable/Disable User credentials (setUserCredentialsEnabled)"", notes = ""Enables or Disables user credentials. Useful when you would like to block user account without deleting it. "" + PAGE_DATA_PARAMETERS + TENANT_AUTHORITY_PARAGRAPH) @PreAuthorize(""hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')"") @PostMapping(value = ""/user/{userId}/userCredentialsEnabled"") public void setUserCredentialsEnabled( @Parameter(description = USER_ID_PARAM_DESCRIPTION) @PathVariable(USER_ID) String strUserId, @Parameter(description = ""Enable (\""true\"") or disable (\""false\"") the credentials."", schema = @Schema(defaultValue = ""true"")) @RequestParam(required = false, defaultValue = ""true"") boolean userCredentialsEnabled) throws ThingsboardException { checkParameter(USER_ID, strUserId); UserId userId = new UserId(toUUID(strUserId)); checkUserId(userId, Operation.WRITE); TenantId tenantId = getCurrentUser().getTenantId(); userService.setUserCredentialsEnabled(tenantId, userId, userCredentialsEnabled); if (!userCredentialsEnabled) { eventPublisher.publishEvent(new UserCredentialsInvalidationEvent(userId)); } }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9842357635498047,0.01576417125761509
67,"public static final Logger AUDITLOG = LoggerFactory.getLogger(""SecurityLogger.""+Server.class.getName());",audit_accountability,unrelated,False,true_audit_accountability_predicted_unrelated,0.0006616939790546894,0.9993383288383484
72,"@Override protected int incrementCurrentKeyId() { try { incrSharedCount(keyIdSeqCounter, 1); } catch (InterruptedException e) { LOG.debug(""Thread interrupted while performing keyId increment"", e); Thread.currentThread().interrupt(); } catch (Exception e) { throw new RuntimeException(""Could not increment shared keyId counter !!"", e); } return keyIdSeqCounter.getCount(); }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9964644908905029,0.0035354746505618095
84,"synchronized void processWatchEvent(ZooKeeper zk, WatchedEvent event) { Event.EventType eventType = event.getType(); if (isStaleClient(zk)) return; if (LOG.isDebugEnabled()) { LOG.debug(""Watcher event type: "" + eventType + "" with state:"" + event.getState() + "" for path:"" + event.getPath() + "" connectionState: "" + zkConnectionState + "" for "" + this); } if (eventType == Event.EventType.None) { switch (event.getState()) { case SyncConnected: LOG.info(""Session connected.""); ConnectionState prevConnectionState = zkConnectionState; zkConnectionState = ConnectionState.CONNECTED; if (prevConnectionState == ConnectionState.DISCONNECTED && wantToBeInElection) { monitorActiveStatus(); } break; case Disconnected: LOG.info(""Session disconnected. Entering neutral mode...""); zkConnectionState = ConnectionState.DISCONNECTED; enterNeutralMode(); break; case Expired: LOG.info(""Session expired. Entering neutral mode and rejoining...""); enterNeutralMode(); reJoinElection(0); break; case SaslAuthenticated: LOG.info(""Successfully authenticated to ZooKeeper using SASL.""); break; default: fatalError(""Unexpected Zookeeper watch event state: "" + event.getState()); break; } return; } String path = event.getPath(); if (path != null) { switch (eventType) { case NodeDeleted: if (state == State.ACTIVE) { enterNeutralMode(); } joinElectionInternal(); break; case NodeDataChanged: monitorActiveStatus(); break; default: if (LOG.isDebugEnabled()) { LOG.debug(""Unexpected node event: "" + eventType + "" for path: "" + path); } monitorActiveStatus(); } return; } fatalError(""Unexpected watch error from Zookeeper""); }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9894054532051086,0.010594533756375313
91,"private void disconnect(FTPClient client) throws IOException { if (client != null) { if (!client.isConnected()) { throw new FTPException(""Client not connected""); } boolean logoutSuccess = client.logout(); client.disconnect(); if (!logoutSuccess) { LOG.warn(""Logout failed while disconnecting, error code - "" + client.getReplyCode()); } } }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9959501028060913,0.004049923270940781
92,"private void readTagFromConfig(String attributeValue, String confName, String confValue, String[] confSource) { for (String tagStr : attributeValue.split("","")) { try { tagStr = tagStr.trim(); if (confValue == null) { confValue = """"; } if (propertyTagsMap.containsKey(tagStr)) { propertyTagsMap.get(tagStr).setProperty(confName, confValue); } else { Properties props = new Properties(); props.setProperty(confName, confValue); propertyTagsMap.put(tagStr, props); } } catch (Exception ex) { LOG.trace(""Tag '{}' for property:{} Source:{}"", tagStr, confName, confSource, ex); } } }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.70677250623703,0.29322749376296997
95,"@Override public boolean renameFile(String from, String to) throws GenericFileOperationFailedException { lock.lock(); try { LOG.debug(""Renaming file: {} to: {}"", from, to); reconnectIfNecessary(null); to = FileUtil.compactPath(to, '/'); channel.rename(from, to); return true; } catch (SftpException e) { LOG.debug(""Cannot rename file from: {} to: {}"", from, to, e); throw new GenericFileOperationFailedException(""Cannot rename file from: "" + from + "" to: "" + to, e); } finally { lock.unlock(); } }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9793726801872253,0.02062731422483921
101,"private Set<String> fetchGroupSet(String user) throws IOException { long startMs = timer.monotonicNow(); Set<String> groups = impl.getGroupsSet(user); long endMs = timer.monotonicNow(); long deltaMs = endMs - startMs ; UserGroupInformation.metrics.addGetGroups(deltaMs); if (deltaMs > warningDeltaMs) { LOG.warn(""Potential performance problem: getGroups(user="" + user +"") "" + ""took "" + deltaMs + "" milliseconds.""); } return groups; }",unrelated,audit_accountability,False,true_unrelated_predicted_audit_accountability,0.9952043294906616,0.004795738961547613
|