forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce HTTP security policy mapping between roles and permissions
closes: quarkusio#12219
- Loading branch information
1 parent
6b05412
commit b8d5159
Showing
22 changed files
with
1,037 additions
and
19 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
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
9 changes: 9 additions & 0 deletions
9
.../vertx-http/deployment/src/test/java/io/quarkus/vertx/http/security/CustomPermission.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,9 @@ | ||
package io.quarkus.vertx.http.security; | ||
|
||
import java.security.BasicPermission; | ||
|
||
public class CustomPermission extends BasicPermission { | ||
public CustomPermission(String name) { | ||
super(name); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
.../deployment/src/test/java/io/quarkus/vertx/http/security/CustomPermissionWithActions.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,38 @@ | ||
package io.quarkus.vertx.http.security; | ||
|
||
import java.security.Permission; | ||
|
||
import io.quarkus.security.StringPermission; | ||
|
||
public class CustomPermissionWithActions extends Permission { | ||
|
||
private final Permission delegate; | ||
|
||
public CustomPermissionWithActions(String name, String[] actions) { | ||
super(name); | ||
this.delegate = new StringPermission(name, actions); | ||
} | ||
|
||
@Override | ||
public boolean implies(Permission permission) { | ||
if (permission instanceof CustomPermissionWithActions) { | ||
return delegate.implies(((CustomPermissionWithActions) permission).delegate); | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
return delegate.equals(obj); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return delegate.hashCode(); | ||
} | ||
|
||
@Override | ||
public String getActions() { | ||
return delegate.getActions(); | ||
} | ||
} |
Oops, something went wrong.