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

Fixes #12203: Interface to manage ACL and user token for API authorization #39

Closed
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PUB_LIBS = plugins-common
PRIV_LIBS = plugins-common-private
LIBS= $(PUB_LIBS) $(PRIV_LIBS)

PLUGINS = blank-template helloworld datasources node-external-reports branding
PLUGINS = blank-template helloworld datasources node-external-reports branding api-authorizations
PLUGINS-LICENSED = $(addsuffix -licensed,$(PLUGINS))
ALL = $(LIBS) $(PLUGINS)

Expand Down
14 changes: 0 additions & 14 deletions api-authorizations/.gitignore

This file was deleted.

30 changes: 16 additions & 14 deletions api-authorizations/build.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#

# This file defines the release information about the plugin like
# its version and its ABI compability.
#
Expand All @@ -7,20 +7,22 @@
#

# Unique identifier of the plugin
plugin-id=rudder-plugin-api-authorizations
# Human readable name
plugin-name=Fine grained authorizations (ACL) for APIs
plugin-name=api-authorizations
# the full name is derived from rudder-plugin-name
plugin-fullname=rudder-plugin-${plugin-name}

# Human readable short/title descrption (used for one line text)
plugin-title-description=Fine grained authorizations (ACL) for APIs
# WEB, HTML description.
plugin-web-description="""<p>This plugins allow to use and configure fine grained authorizations
for API tokens.</p>"""

# Plugin version. It is build as follow: A.B-x.y(.z) with:
# - A.B: Rudder major.minor
# - x.y(.z): plugin major.minor.micro. Micro should be omitted. When omitted, z is assumed to be 0.
# For the build, we split the information between two properties, rudder branch and plugin version,
# which must be concaneted with "-" to build the plugin version.
rudder-branch=4.3
plugin-branch=0.1
plugin-version=${rudder-branch}-${plugin-branch}
# - x.y(.z): plugin major.minor.micro. Micro should be omitted. When omitted, z is assumed to be 0.
# For the build, we split the information between two properties, rudder branch and plugin version,
# which must be concaneted with "-" to build the plugin version.
plugin-branch=1.0-SNAPSHOT

# Version of Rudder used to build the plugin.
# It defined the API/ABI used and it is important for binary compatibility
#
rudder-build-version=4.3.0
# rudder branch comes from parent
plugin-version=${rudder-branch}-${plugin-branch}
155 changes: 155 additions & 0 deletions api-authorizations/pom-template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.normation.plugins</groupId>
<artifactId>api-authorizations</artifactId>
<packaging>jar</packaging>
<!--
Do not change version here, update content into: build.conf
-->
<version>${plugin-version}</version>

<parent>
<groupId>com.normation.plugins</groupId>
<artifactId>plugins-parent</artifactId>
<version>${rudder-branch}-${parent-version}</version>
</parent>

<description>
This plugin allows to define fine grained authorization for Rudder REST API.
</description>


<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<!-- common data definition for plugins -->
<dependency>
<groupId>com.normation.plugins</groupId>
<artifactId>plugins-common</artifactId>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
</dependencies>



<!-- I hate maven. 100 lines for a F**** if/then/else. -->

<!-- Internal profile: FOR INTERNAL USE ONLY - active if -Dlimited is *not* specified. -->
<profiles>
<profile>
<id>internal-default</id>
<activation>
<!-- Activation via *absence* of a system property to ensure mutual exclusivity
of this profile with internal-limited -->
<property><name>!limited</name></property>
</activation>
<build><plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/src/main/scala-templates/default</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins></build>
</profile>
<!-- Internal profile: FOR INTERNAL USE ONLY - active if -Dlimited is *not* specified. -->
<profile>
<id>internal-limited</id>
<activation>
<!-- Activation via *presence* of a system property to ensure mutual exclusivity
of this profile with internal-default -->
<property><name>limited</name></property>
</activation>
<build><plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>filter-src</id>
<goals>
<goal>filter-sources</goal>
</goals>
<configuration>
<sourceDirectory>${basedir}/src/main/scala-templates/limited</sourceDirectory>
<outputDirectory>${project.build.directory}/generated</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-license-checker-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins></build>
<dependencies>
<dependency>
<groupId>com.normation.plugins</groupId>
<artifactId>plugins-common-private</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>rudder-release-private</id>
<url>http://nexus.normation.com/nexus/content/repositories/private-releases/</url>
<layout>default</layout>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>rudder-snapshot-private</id>
<url>http://nexus.normation.com/nexus/content/repositories/private-snapshots/</url>
<layout>default</layout>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
</profiles>
</project>
Loading