Skip to content

Commit

Permalink
Merge pull request #28 from w6d-io/develop
Browse files Browse the repository at this point in the history
[FIX] data send to to opa add wrong name
  • Loading branch information
nhaquet-w6d authored Nov 7, 2023
2 parents a2e220e + 3732dc9 commit e36ba06
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/opa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::config::SiriusConfig;

#[derive(Deserialize, Serialize)]
struct Input<'a> {
url: &'a str,
uri: &'a str,
method: &'a str,
role: &'a str, // scop? add to option file
resource: &'a str,
Expand All @@ -17,7 +17,7 @@ struct Input<'a> {
struct OpaData<'a> {
#[serde(borrow)]
input: Input<'a>,
identity: Identity,
data: Identity,
}
pub async fn validate_roles(
config: &SiriusConfig,
Expand All @@ -27,14 +27,14 @@ pub async fn validate_roles(
uri: &str,
) -> Result<bool> {
let input = Input {
url: uri,
method: "get",
role: "owner", //get from conf file
uri,
method: "post",
role: "unused", //get from conf file
resource: project_id,
};
let opa = OpaData {
input,
identity: identity.to_owned(),
data: identity.to_owned(),
};
let client = match &config.kratos.client {
Some(client) => client,
Expand Down

0 comments on commit e36ba06

Please sign in to comment.