Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

final refactoring #1119

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cs-httpclient-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>io.cloudslang.content</groupId>
<artifactId>cs-httpclient-commons</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/*
* (c) Copyright 2019 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* (c) Copyright 2022 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
Expand Down Expand Up @@ -88,6 +102,7 @@ public class GetAuthorizationTokenV2 {
public Map<String, String> execute(@Param(value = LOGIN_TYPE, description = LOGIN_TYPE_DESC) String loginType,
@Param(value = CLIENT_ID, required = true, description = CLIENT_ID_DESC) String clientId,
@Param(value = CLIENT_SECRET, encrypted = true, description = CLIENT_SECRET_DESC) String clientSecret,
@Param(value = RESOURCE, description = RESOURCES_DESC) String resource,
@Param(value = USERNAME, description = USERNAME_DESC) String username,
@Param(value = PASSWORD, encrypted = true, description = PASSWORD_DESC) String password,
@Param(value = LOGIN_AUTHORITY, required = true, description = LOGIN_AUTHORITY_DESC) String loginAuthority,
Expand All @@ -111,6 +126,10 @@ public Map<String, String> execute(@Param(value = LOGIN_TYPE, description = LOGI
return getFailureResultsMap(StringUtilities.join(exceptionMessages, NEW_LINE));
}

if(!resource.isEmpty()){
scope = resource;
}

try {
final IAuthenticationResult result = AuthorizationTokenV2Impl.getToken(AuthorizationTokenInputs.builder()
.loginType(loginType)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/*
* (c) Copyright 2019 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* (c) Copyright 2022 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
Expand Down
15 changes: 15 additions & 0 deletions cs-openshift/header-definitions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<additionalHeaders>
<cs-io.cloudslang.content.oracle.cloud.actions-java-header>
<firstLine>/*</firstLine>
<beforeEachLine> </beforeEachLine>
<endLine> */</endLine>
<afterEachLine> </afterEachLine>
<firstLineDetectionPattern>/*</firstLineDetectionPattern>
<lastLineDetectionPattern> */</lastLineDetectionPattern>
<emptyLineAfterHeader>true</emptyLineAfterHeader>
<allowBlankLines>false</allowBlankLines>
<isMultiline>true</isMultiline>
<padLines>false</padLines>
</cs-io.cloudslang.content.oracle.cloud.actions-java-header>
</additionalHeaders>
12 changes: 12 additions & 0 deletions cs-openshift/license.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* (c) Copyright ${copyright.year} Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
252 changes: 252 additions & 0 deletions cs-openshift/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

* (c) Copyright 2022 Micro Focus, L.P.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License v2.0 which accompany this distribution.
*
* The Apache License is available at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.cloudslang.content</groupId>
<artifactId>cs-openshift</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>Openshift</description>
<url>https://github.com/CloudSlang/cs-actions</url>

<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<scm>
<connection>scm:git:https://CloudSlang/cs-actions.git</connection>
<developerConnection>scm:git:[email protected]:CloudSlang/cs-actions.git</developerConnection>
<url>https://github.com/CloudSlang/cs-actions.git</url>
<tag>master</tag>
</scm>

<distributionManagement>
<repository>
<id>ossrh</id>
<name>Maven Central staging repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Maven Central snapshots repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<properties>
<!--Maven versions-->
<maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
<maven-release-plugin.version>2.5.2</maven-release-plugin.version>
<maven-javadoc-plugin.version>2.10.4</maven-javadoc-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<!--Dependencies versions-->
<score-content-sdk.version>1.10.7</score-content-sdk.version>
<cs-commons.version>0.0.5</cs-commons.version>
<cs-http-client.version>0.1.74</cs-http-client.version>
<!--Misc properties-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.sources.skip>true</maven.sources.skip>
<custom.nexus>overwritten_by_ci</custom.nexus>
</properties>

<dependencies>
<dependency>
<groupId>com.hp.score.sdk</groupId>
<artifactId>score-content-sdk</artifactId>
<version>${score-content-sdk.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.cloudslang.content</groupId>-->
<!-- <artifactId>cs-commons</artifactId>-->
<!-- <version>${cs-commons.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>io.cloudslang.content</groupId>
<artifactId>cs-httpclient-commons</artifactId>
<version>0.0.2-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>

</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>${project.basedir}/license.template</header>
<headerDefinitions>
<headerDefinition>${project.basedir}/header-definitions.xml</headerDefinition>
</headerDefinitions>
<includes>
<include>**/*.java</include>
<include>pom.xml</include>
</includes>
<properties>
<copyright.year>2022</copyright.year>
</properties>
<useDefaultMapping>false</useDefaultMapping>
<mapping>
<java>cs-actions-java-header</java>
<xml>XML_STYLE</xml>
</mapping>
</configuration>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>gpg</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deploy-internal</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<executions>
<execution>
<id>custom-deployment-to-nexus</id>
<goals>
<goal>deploy</goal>
</goals>
<phase>deploy</phase>
<configuration>
<altDeploymentRepository>${custom.nexus}</altDeploymentRepository>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Loading