小编use*_*589的帖子

graphql中的AST是什么?

graphql中的AST是什么?我正在使用graphql-js.它对任何事情有何帮助?

任何文档中的任何内容似乎都不能解释AST是什么

graphql graphql-js

17
推荐指数
1
解决办法
5862
查看次数

nodejs ldap 身份验证失败

我正在使用 activedirectory npm 包对企业中的 activedirectory 进行身份验证。发现验证问题,而我之前在其他软件中已经多次这样做了。

var ActiveDirectory = require('activedirectory');
var config = { url: 'ldap://<ldap server>:389',

            baseDN:'DC=ads,DC=dwdwdw,DC=com',
            bindDN: 'CN=dddd,OU=ServiceAccounts,OU=Process,DC=ads,DC=dwdwdw,DC=com',
            bindCredentials: 'vBAX5y5@',
            includeMembership:['user'],
             referrals: {
                 enabled: false,
                 excluded: [ ]
               },
               attributes: {

                   user: [ 'sAMAccountName' ],
                   group: [ 'distinguishedName' ]
                 },
               //filter: '(&(objectcategory=person)(objectclass=user)(|(samaccountname={{username}})(mail={{mail}})))'
                 //filter: '(&(objectcategory=*)(|(samaccountname={{username}})))'

             }

var sAMAccountName = 'sss';
var password = 'password';
var username = sAMAccountName;
ad.authenticate(sAMAccountName, password, function(err, auth) {
  if (err) {
   console.log('ERROR: '+JSON.stringify(err));
   return;
 }
Run Code Online (Sandbox Code Playgroud)

当我运行此 nodejs 脚本时,出现以下错误:

错误:{“lde_message”:“80090308:LdapErr:DSID-0C09042F,评论:AcceptSecurityContext 错误,数据 52e,v2580\u0000”,“lde_dn”:null}

可以肯定地说,我不知道我在做什么。

但我知道 searchAttribute …

node.js ldapjs

6
推荐指数
0
解决办法
3429
查看次数

Ansible 中角色的串行执行

我有一个定义如下的剧本:

- name: install percona rpms
  hosts: imdp
  roles:
    - role1
    - role2
    - role3
    - role4
Run Code Online (Sandbox Code Playgroud)

我只希望角色 3 中定义的任务能够串行执行。如果我serial: 1在 role3 任务中定义,它不起作用。所有任务都是并行执行的。但是如果我serial: 1在主yaml(上面的yaml)中定义,那么所有角色都会串行执行,这也是不需要的。

我怎样才能让role3串行执行?

ansible ansible-role

6
推荐指数
1
解决办法
3339
查看次数

RequestBody JSON格式具有单引号

我的SpringBoot应用程序中有一个控制器类。

@RestController
@RequestMapping("/{database}/alerts")
public class ControllerB {
  @Autowired private ServiceB serviceB;

  @Autowired
  private B b;

  @Autowired
  ControllerB(B b,ServiceB serviceB){
      this.b = b;
      this.serviceB = serviceB;
  }

  @RequestMapping(method = RequestMethod.POST)
  public B dosomethingCrazy(@RequestBody BImpl bimpl)  {


      String response = serviceB.dosomethingImportant();
      return bimpl;

  }

}
Run Code Online (Sandbox Code Playgroud)

当requestBody的值中包含单引号时,就会出现问题。例如,如果请求正文为{“ name”:“ peter o'toole”},则会抛出http 400

“状态”:400,“错误”:“错误的请求”,“异常”:“ org.springframework.http.converter.HttpMessageNotReadableException”,“消息”:“ JSON解析错误:VALUE_STRING中意外的输入结束

知道杰克逊如何将单引号值映射到对象字段吗?

java spring jackson

2
推荐指数
2
解决办法
950
查看次数

将 Spring Boot Starter Web 依赖项与 Mongo Driver 3.11.0 一起使用时出现 java.lang.NoSuchMethodError

将 Spring Boot Starter Web 依赖项与最新的 MongoDB 驱动程序 3.11.0 一起使用会出现以下错误。当我切换到旧版本的 Mongo Driver(如 3.8.2)时,效果很好。有任何想法吗?我应该排除 Mongo 依赖吗?

如果我删除 spring boot 依赖项,Mongo 连接工作正常。

06:39:09.046 [main] INFO org.mongodb.driver.cluster - Cluster created with settings {hosts=[host1:27017, host2:27017, host3:27017], mode=MULTIPLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
06:39:09.048 [main] INFO org.mongodb.driver.cluster - Adding discovered server host1:27017 to client view of cluster
06:39:09.079 [main] INFO org.mongodb.driver.cluster - Adding discovered server host2:27017 to client view of cluster
06:39:09.080 [main] INFO org.mongodb.driver.cluster - Adding discovered server host3:27017 to client view of cluster
06:39:09.083 …
Run Code Online (Sandbox Code Playgroud)

java spring mongodb spring-boot

0
推荐指数
1
解决办法
2394
查看次数