-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into echarts-json-rerender-fix
- Loading branch information
Showing
17 changed files
with
368 additions
and
17 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/user/model/APIKey.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,33 @@ | ||
package org.lowcoder.domain.user.model; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.function.Function; | ||
|
||
@Getter | ||
@Setter | ||
public class APIKey { | ||
|
||
private String id; | ||
private String name; | ||
private String description; | ||
private String token; | ||
|
||
public APIKey(@Nullable String id, String name, String description, String token) { | ||
this.id = id; | ||
this.name = name; | ||
this.description = description; | ||
this.token = token; | ||
} | ||
|
||
public void doEncrypt(Function<String, String> encryptFunc) { | ||
this.token = encryptFunc.apply(token); | ||
} | ||
|
||
public void doDecrypt(Function<String, String> decryptFunc) { | ||
this.token = decryptFunc.apply(token); | ||
} | ||
|
||
} |
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
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
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
27 changes: 27 additions & 0 deletions
27
...vice/lowcoder-server/src/main/java/org/lowcoder/api/authentication/dto/APIKeyRequest.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,27 @@ | ||
package org.lowcoder.api.authentication.dto; | ||
|
||
import org.apache.commons.collections4.MapUtils; | ||
import org.apache.commons.lang3.ObjectUtils; | ||
|
||
import java.util.HashMap; | ||
|
||
import static org.lowcoder.sdk.util.IDUtils.generate; | ||
|
||
public class APIKeyRequest extends HashMap<String, Object> { | ||
|
||
public String getId() { | ||
return ObjectUtils.firstNonNull(getString("id"), generate()); | ||
} | ||
|
||
public String getName() { | ||
return getString("name"); | ||
} | ||
|
||
public String getDescription() { | ||
return getString("description"); | ||
} | ||
|
||
public String getString(String key) { | ||
return MapUtils.getString(this, key); | ||
} | ||
} |
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
Oops, something went wrong.