-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What changes were proposed in this pull request? Support Kerberos authentication. ### Why are the changes needed? To add support for Kerberos authentication. Fix: #5384 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Tested locally.
- Loading branch information
1 parent
99a999a
commit 70838ef
Showing
5 changed files
with
113 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
clients/cli/src/main/java/org/apache/gravitino/cli/KerberosData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License 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. | ||
*/ | ||
|
||
package org.apache.gravitino.cli; | ||
|
||
public class KerberosData { | ||
protected final String principal; | ||
protected final String keytabFile; | ||
|
||
/** | ||
* Constructs an {@code KerberosData} instance with the specified principal and keytab file. | ||
* | ||
* @param principal the Kerberos principal (e.g. a user or service identity) | ||
* @param keytabFile the path to the keytab file | ||
*/ | ||
public KerberosData(String principal, String keytabFile) { | ||
this.principal = principal; | ||
this.keytabFile = keytabFile; | ||
} | ||
|
||
/** | ||
* Returns the Kerberos principal associated with this {@code KerberosData}. | ||
* | ||
* @return the principal | ||
*/ | ||
public String getPrincipal() { | ||
return principal; | ||
} | ||
|
||
/** | ||
* Returns the keytab file path associated with this {@code KerberosData}. | ||
* | ||
* @return the keytab file path | ||
*/ | ||
public String getKeytabFile() { | ||
return keytabFile; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,15 @@ token=test | |
scope=token/test | ||
``` | ||
|
||
Kerberos authentication can also be configured via the configuration file. | ||
|
||
```text | ||
# Authentication | ||
auth=kerberos | ||
principal=user/[email protected] | ||
keytabFile=file.keytab | ||
``` | ||
|
||
### Potentially unsafe operations | ||
|
||
For operations that delete data or rename a metalake the user with be prompted to make sure they wish to run this command. The `--force` option can be specified to override this behaviour. | ||
|