Skip to content

Commit

Permalink
fix(): Add auth-api as compileOnly dependency (datahub-project#6747)
Browse files Browse the repository at this point in the history
Co-authored-by: MohdSiddique Bagwan <[email protected]>
  • Loading branch information
2 people authored and cccs-Dustin committed Feb 1, 2023
1 parent 076b88b commit d7076b0
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ Instead, custom authenticators are useful for authenticating API requests to Dat
The sample authenticator implementation can be found at [Authenticator Sample](../metadata-service/plugin/src/test/sample-test-plugins)

### Implementing an Authentication Plugin
1. Add _datahub-auth-api_ as implementation dependency: Maven coordinates of _datahub-auth-api_ can be found at [Maven](https://mvnrepository.com/artifact/io.acryl/datahub-auth-api)
1. Add _datahub-auth-api_ as compileOnly dependency: Maven coordinates of _datahub-auth-api_ can be found at [Maven](https://mvnrepository.com/artifact/io.acryl/datahub-auth-api)

Example of gradle dependency is given below.

```groovy
dependencies {
implementation 'io.acryl:datahub-auth-api:0.8.45'
def auth_api = 'io.acryl:datahub-auth-api:0.9.3-3rc3'
compileOnly "${auth_api}"
testImplementation "${auth_api}"
}
```

Expand Down Expand Up @@ -65,13 +69,13 @@ The sample authenticator implementation can be found at [Authenticator Sample](.
To see an example of building an uber jar, check out the `build.gradle` file for the apache-ranger-plugin file of [Apache Ranger Plugin](https://github.com/acryldata/datahub-ranger-auth-plugin/tree/main/apache-ranger-plugin) for reference.
Exclude datahub plugin dependency and signature classes as shown in below `shadowJar` task.
Exclude signature files as shown in below `shadowJar` task.
```groovy
apply plugin: 'com.github.johnrengelman.shadow';
shadowJar {
// Exclude com.datahub.plugins package and files related to jar signature
exclude "com/linkedin/common/", "com/datahub/", "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
exclude "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
}
```
5. Refer section [Plugin Installation](#plugin-installation) for plugin installation in DataHub environment
Expand Down Expand Up @@ -104,8 +108,20 @@ The sample authorizer implementation can be found at [Authorizer Sample](https:/
### Implementing an Authorization Plugin
1. Add _datahub-auth-api_ as implementation dependency: Maven coordinates of _datahub-auth-api_ can be found at [Maven](https://mvnrepository.com/artifact/io.acryl/datahub-auth-api)
1. Add _datahub-auth-api_ as compileOnly dependency: Maven coordinates of _datahub-auth-api_ can be found at [Maven](https://mvnrepository.com/artifact/io.acryl/datahub-auth-api)
Example of gradle dependency is given below.
```groovy
dependencies {
def auth_api = 'io.acryl:datahub-auth-api:0.9.3-3rc3'
compileOnly "${auth_api}"
testImplementation "${auth_api}"
}
```
2. Implement the Authorizer interface: [Authorizer Sample](https://github.com/acryldata/datahub-ranger-auth-plugin/tree/main/apache-ranger-plugin)
<details>
Expand Down Expand Up @@ -140,15 +156,16 @@ The sample authorizer implementation can be found at [Authorizer Sample](https:/

To see an example of building an uber jar, check out the `build.gradle` file for the apache-ranger-plugin file of [Apache Ranger Plugin](https://github.com/acryldata/datahub-ranger-auth-plugin/tree/main/apache-ranger-plugin) for reference.

Exclude datahub plugin dependency and signature classes as shown in below `shadowJar` task.
Exclude signature files as shown in below `shadowJar` task.

```groovy
apply plugin: 'com.github.johnrengelman.shadow';
shadowJar {
// Exclude com.datahub.plugins package and files related to jar signature
exclude "com/linkedin/common/", "com/datahub/", "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
exclude "META-INF/*.RSA", "META-INF/*.SF","META-INF/*.DSA"
}
```


5. Install the Plugin: Refer to the section (Plugin Installation)[#plugin_installation] for plugin installation in DataHub environment

Expand Down

0 comments on commit d7076b0

Please sign in to comment.