Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ members = [
"crates/catalog-sql",
"crates/config",
"crates/core",
"crates/core-types",
"crates/federation-sql",
"crates/identity-sql",
"crates/idmapping-sql",
"crates/k8s-auth-sql",
"crates/keystone",
"crates/resource-sql",
"crates/role-sql",
"crates/storage",
"crates/token-fernet",
"crates/token-restriction-sql",
"crates/trust-sql",
"crates/revoke-sql",
"crates/webauthn",
"tests/api",
"tests/integration",
"tests/federation", "crates/token-restriction-sql", "crates/identity-sql",
"tests/federation",
]
exclude = [
"tests/loadtest"
Expand Down Expand Up @@ -87,7 +90,7 @@ serde_json = { version = "1.0" }
serde_urlencoded = { version = "0.7" }
tempfile = { version = "3.27" }
thiserror = { version = "2.0" }
tokio = { version = "1.50" }
tokio = { version = "1.50", default-features = false }
tokio-util = { version = "0.7" }
tonic = { version = "0.14" }
tonic-prost-build = { version = "0.14" }
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN USER=root cargo new keystone

WORKDIR /usr/src/keystone

RUN USER=root cargo new --name core --lib crates/core
RUN USER=root cargo new --name core-types --lib crates/core-types
RUN USER=root cargo new --name api-types --lib crates/api-types

RUN USER=root cargo new --name appcred-sql --lib crates/appcred-sql
RUN USER=root cargo new --name assignment-sql --lib crates/assignment-sql
RUN USER=root cargo new --name catalog-sql --lib crates/catalog-sql
Expand All @@ -35,6 +39,7 @@ COPY crates/appcred-sql/Cargo.toml /usr/src/keystone/crates/appcred-sql/
COPY crates/assignment-sql/Cargo.toml /usr/src/keystone/crates/assignment-sql/
COPY crates/config/Cargo.toml /usr/src/keystone/crates/config/
COPY crates/core/Cargo.toml /usr/src/keystone/crates/core/
COPY crates/core-types/Cargo.toml /usr/src/keystone/crates/core-types/
COPY crates/catalog-sql/Cargo.toml /usr/src/keystone/crates/catalog-sql/
COPY crates/federation-sql/Cargo.toml /usr/src/keystone/crates/federation-sql/
COPY crates/identity-sql/Cargo.toml /usr/src/keystone/crates/identity-sql/
Expand All @@ -58,17 +63,12 @@ RUN mkdir -p crates/keystone/src/bin && touch crates/keystone/src/lib.rs &&\
cp src/main.rs crates/keystone/src/bin/keystone_db.rs &&\
mkdir -p tests/loadtest/src &&\
cp src/main.rs tests/loadtest/src/main.rs &&\
mkdir -p crates/api-types/src && touch crates/api-types/src/lib.rs &&\
mkdir -p crates/config/src && touch crates/config/src/lib.rs &&\
mkdir -p crates/core/src && touch crates/core/src/lib.rs &&\
mkdir -p crates/storage/src && touch crates/storage/src/lib.rs &&\
mkdir -p crates/token-fernet/src && touch crates/token-fernet/src/lib.rs &&\
mkdir -p crates/token-fernet/benches && touch crates/token-fernet/benches/fernet_token.rs &&\
mkdir -p crates/webauthn/src && touch crates/webauthn/src/lib.rs

# Set the working directory
#WORKDIR /usr/src/keystone

## This is a dummy build to get the dependencies cached.
#RUN cargo build --target x86_64-unknown-linux-musl --release
RUN cargo build -p openstack-keystone --release
Expand All @@ -77,6 +77,7 @@ RUN cargo build -p openstack-keystone --release
COPY crates/keystone/ /usr/src/keystone/crates/keystone
COPY crates/config/ /usr/src/keystone/crates/config
COPY crates/core/ /usr/src/keystone/crates/core
COPY crates/core-types/ /usr/src/keystone/crates/core-types
COPY crates/api-types/ /usr/src/keystone/crates/api-types
COPY crates/storage/ /usr/src/keystone/crates/storage
COPY crates/token-fernet/ /usr/src/keystone/crates/token-fernet
Expand Down
8 changes: 8 additions & 0 deletions crates/api-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,24 @@ default = []
builder = ["dep:derive_builder"]
openapi = ["dep:utoipa"]
validate = ["dep:validator"]
conv = ["dep:axum", "dep:openstack-keystone-core-types", "dep:uuid", "builder", "dep:serde_urlencoded", "dep:url", "dep:validator"]

[dependencies]
axum = { workspace = true, features = ["json"], optional = true }
base64.workspace = true
chrono = { workspace = true, features = ["serde"] }
derive_builder = { workspace = true, optional = true }
eyre.workspace = true
http = { workspace = true, optional = true }
openstack-keystone-core-types = { version = "0.1", path = "../core-types/", optional = true }
secrecy = { workspace = true, features = ["serde"] }
serde.workspace = true
serde_json.workspace = true
serde_urlencoded = { workspace = true, optional = true }
thiserror.workspace = true
utoipa = { workspace = true, features = ["chrono"], optional = true }
validator = { workspace = true, features = ["derive"], optional = true }
webauthn-rs-proto.workspace = true
url = { workspace = true, optional = true }
uuid = { workspace = true, features = ["v4"], optional = true }

29 changes: 29 additions & 0 deletions crates/api-types/src/catalog_conv.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed 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.
//
// SPDX-License-Identifier: Apache-2.0
//! Keystone API types.
use openstack_keystone_core_types::catalog as provider_types;

use crate::catalog as api_types;

impl From<provider_types::Endpoint> for api_types::Endpoint {
fn from(value: provider_types::Endpoint) -> Self {
Self {
id: value.id.clone(),
interface: value.interface.clone(),
url: value.url.clone(),
region: value.region_id.clone(),
region_id: value.region_id.clone(),
}
}
}
Loading
Loading