小编Lee*_*Lee的帖子

如何为Jenkins Bitbucket Branch Source插件添加扫描凭据?

我正在尝试设置CloudBees Bitbucket分支源插件,但我无法设置凭据.我已添加用户名和密码凭据,但下拉列表仍为空.

我正在使用Jenkins版本2.9的新安装以及Bitbucket Branch源插件版本1.5.

在此输入图像描述

这是我添加的凭据.我还在之前的尝试中添加了带有私钥的SSH用户名. 在此输入图像描述

我使用docker安装了jenkins,然后添加了插件.这是我的docker-compose文件的jenkins部分

jenkins:
image: jenkinsci/jenkins:latest
#image: arcanneero/cd-jenkins-pipeline
ports:
  - "8080:8080"
  - "50000:50000"
volumes:
  - ./jenkins/data:/var/jenkins_home
Run Code Online (Sandbox Code Playgroud)

jenkins cloudbees jenkins-pipeline

7
推荐指数
1
解决办法
2809
查看次数

UINavigationController工具栏 - 使用UIActivityIndi​​catorView添加状态文本

我想在我的应用程序中添加一个加载活动指示器,类似于邮件应用程序中的状态文本.我正在使用UINavigationController,所以我知道我需要在每个我希望它显示的视图上设置toolbarItems数组.我可以添加活动指示器,它确实显示,但当我尝试使用下面的代码添加文本字段时,文本不显示.有没有办法以编程方式创建一个具有状态文本和UIActivityIndi​​catorView的容器,如果将其添加到toolbarItems数组中,它将显示出来.

UIBarButtonItem *textFieldItem = [[[UIBarButtonItem alloc] initWithCustomView:textField] autorelease];
self.toolbarItems = [NSArray arrayWithObject:textFieldItem];
Run Code Online (Sandbox Code Playgroud)

更新:我根据来自pdriegen的代码创建了一个派生自UIView的类.
我还将此代码添加到我的控制器中的viewDidLoad

UIProgressViewWithLabel * pv = [[UIProgressViewWithLabel alloc] init];

UIBarButtonItem * pvItem = [[UIBarButtonItem alloc] initWithCustomView:pv];

[self setToolbarItems:[NSMutableArray arrayWithObject:pvItem]];
Run Code Online (Sandbox Code Playgroud)

目前工具栏中没有显示任何内容.我错过了什么?

xcode uinavigationcontroller uibarbuttonitem uiactivityindicatorview ios

3
推荐指数
1
解决办法
1万
查看次数

将 HMAC 函数从 Java 转换为 JavaScript

我打算使用这个 Java 函数作为参考在 NodeJS 中实现一个 HMAC 函数:

private static String printMacAsBase64(byte[] macKey, String counter) throws Exception {
    // import AES 128 MAC_KEY
    SecretKeySpec signingKey = new SecretKeySpec(macKey, "AES");

    // create new HMAC object with SHA-256 as the hashing algorithm
    Mac mac = Mac.getInstance("HmacSHA256");
    mac.init(signingKey);

    // integer -> string -> bytes -> encrypted bytes
    byte[] counterMac = mac.doFinal(counter.getBytes("UTF-8"));

    // base 64 encoded string
    return DatatypeConverter.printBase64Binary(counterMac);
}
Run Code Online (Sandbox Code Playgroud)

由此我得到 Qze5cHfTOjNqwmSSEOd9nEISOobheV833AncGJLin9Y= 的 HMAC

在 node.js 中通过 HMAC 算法传递相同的计数器和密钥时,我得到了不同的 HMAC 值。这是我生成 hmac 的代码。

var decryptedMacKey …
Run Code Online (Sandbox Code Playgroud)

java cryptography hmac node.js

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