Skip to content

Commit

Permalink
70u3 release (#139)
Browse files Browse the repository at this point in the history
Signed-off-by: shweta <[email protected]>
  • Loading branch information
shwetapurohit authored Oct 13, 2021
1 parent 15147a4 commit d0001e5
Show file tree
Hide file tree
Showing 20 changed files with 161 additions and 4 deletions.
Binary file removed lib/vapi-authentication-2.25.0-javadoc.jar
Binary file not shown.
Binary file removed lib/vapi-authentication-2.25.0.jar
Binary file not shown.
Binary file added lib/vapi-authentication-2.30.0-javadoc.jar
Binary file not shown.
Binary file added lib/vapi-authentication-2.30.0.jar
Binary file not shown.
Binary file removed lib/vapi-runtime-2.25.0-javadoc.jar
Binary file not shown.
Binary file added lib/vapi-runtime-2.30.0-javadoc.jar
Binary file not shown.
Binary file not shown.
Binary file removed lib/vapi-samltoken-2.25.0-javadoc.jar
Binary file not shown.
Binary file added lib/vapi-samltoken-2.30.0-javadoc.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/vsphereautomation-lookupservice-1.0.0-javadoc.jar
Binary file not shown.
Binary file modified lib/vsphereautomation-lookupservice-1.0.0.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

<groupId>com.vmware</groupId>
<artifactId>vsphere-samples-nodeps</artifactId>
<version>7.0.2.0</version>
<version>7.0.3.0</version>
<packaging>jar</packaging>

<name>samples</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vapi.version>2.25.0</vapi.version>
<vapi.version>2.30.0</vapi.version>
<slf4j.version>1.7.12</slf4j.version>
<httpclient.version>4.5.13</httpclient.version>
<httpasyncclient.version>4.1.4</httpasyncclient.version>
Expand All @@ -24,7 +24,7 @@
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<lookupservice.version>1.0.0</lookupservice.version>
<vspherewssdk.version>6.7.3</vspherewssdk.version>
<vsphereautomationsdk.version>3.6.0</vsphereautomationsdk.version>
<vsphereautomationsdk.version>3.7.0</vsphereautomationsdk.version>
<vmc.version>1.56.0</vmc.version>
<nsxpolicysdk.version>3.1.2.1.1</nsxpolicysdk.version>
<nsxvmcawsint.version>3.1.2.1.1</nsxvmcawsint.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected void run() throws Exception {

// Force synchronize the subscribed library item to fetch and cache the
// content
this.client.subscribedItemService().sync(subItemId, true);
this.client.subscribedItemService().sync(subItemId, true, false);
syncSuccess = this.clsHelper.waitForItemSync(subItemId,
SYNC_TIMEOUT_SEC,
TimeUnit.SECONDS);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* *******************************************************
* Copyright VMware, Inc. 2021. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
*/
package vmware.samples.vcenter.certificatemanagement.vcenter;

import com.vmware.vcenter.certificate_management.vcenter.SigningCertificate;
import com.vmware.vcenter.certificate_management.vcenter.SigningCertificateTypes.Info;

import java.util.ArrayList;

import org.apache.commons.cli.Option;

import vmware.samples.common.SamplesAbstractBase;

/**
* Sample code to get the Signing Certificate for the vCenter Server. This
* will enable users to view the certificate actively used to sign tokens and
* certificates used for token signature verification.
*/
public class GetSigningCertificate extends SamplesAbstractBase {
private SigningCertificate certService;

@Override
protected void parseArgs(String args[]) {
super.parseArgs(new ArrayList<Option>(), args);
}

@Override
protected void setup() throws Exception {
this.certService =
vapiAuthHelper.getStubFactory().createStub(SigningCertificate.class,
sessionStubConfig);
}
@Override
protected void run() throws Exception {
Info certInfo= certService.get();
if(certInfo == null)
{
System.out.println("ERROR: Signing certificates not found on this vCenter");
}
System.out.println("vCenter signing certificate \n"+certInfo);
}

public static void main(String[] args) throws Exception {
GetSigningCertificate get = new GetSigningCertificate();
get.execute(args);
}

@Override
protected void cleanup() throws Exception {
// No cleanup required
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This directory contains samples for managing vCenter signing certificate:

The samples were tested against vSphere 7.0.3

Author: Andrew Gormley <[email protected]>
Date: 09/15/2021

### SigningCertificate Get operations
Sample | Description
------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------
vmware.samples.vcenter.certificatemanagement.vcenter.GetSigningCerificate.java | Demonstrates SigningCertificate Get operation which displays the active signing certificate chain and certificate chains used to verify token signatures.

### SigningCertificate Refresh operations
Sample | Description
----------------------------------------------------------------------------|------------------------------------
vmware.samples.vcenter.certificatemanagement.vcenter.RefreshSigningCerificate.java | Demonstrates SigningCertificate Refresh operation which creates a new private key and certificate chain issued by VMCA for token signing, and displays the new certificate chain.

### Testbed Requirement:
One (1) vCenter Server
The username being used to run the sample should have the Administrator Role.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* *******************************************************
* Copyright VMware, Inc. 2021. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
*/
package vmware.samples.vcenter.certificatemanagement.vcenter;

import com.vmware.vcenter.certificate_management.X509CertChain;
import com.vmware.vcenter.certificate_management.vcenter.SigningCertificate;

import java.util.Arrays;
import java.util.List;

import org.apache.commons.cli.Option;

import vmware.samples.common.SamplesAbstractBase;

/**
* Sample code to refresh the Signing Certificate for the vCenter Server.
* Use the force option to attempt to force the refresh in environments
* that would otherwise fail. On success, the new signing certificates
* will be printed.
*/
public class RefreshSigningCertificate extends SamplesAbstractBase {
private SigningCertificate certService;
protected boolean force;

@Override
protected void parseArgs(String args[]) {
Option forceOption = Option.builder()
.required(false)
.argName("FORCE")
.longOpt("force")
.desc("Attempt to force refresh")
.build();
List<Option> optionList = Arrays.asList(forceOption);
super.parseArgs(optionList, args);

this.force = parsedOptions.get("force") != null;
}

@Override
protected void setup() throws Exception {
this.certService =
vapiAuthHelper.getStubFactory().createStub(SigningCertificate.class,
sessionStubConfig);
}

@Override
protected void run() throws Exception {
X509CertChain newCert= certService.refresh(this.force);
if(newCert == null ) {
System.out.println("ERROR: refresh signing certificate did not return a certificate");
} else {
System.out.println("New vCenter signing certificate \n"+newCert.toString());
}
}

public static void main(String[] args) throws Exception {
RefreshSigningCertificate get = new RefreshSigningCertificate();
get.execute(args);
}

@Override
protected void cleanup() throws Exception {
// No cleanup required
}
}

0 comments on commit d0001e5

Please sign in to comment.