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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
- Optional security UI for quick bootstrapping (Blazor, and components in auto mode).
- **Designed to manage subscriptions and multi-tenants.**

## News

SvelteKit Frontend added. (not working in Aspire with fnm), so:

`npm install, npm run dev in svelte-link-ui folder`

## Goal

This project allows you to choose any OAuth provider and remain independent in terms of your security design. You can add any frontend (Blazor, Next.js, SvelteKit) or backend APIs in front or behind this security layer. For a full SPA, you can modify Yarp to be a full BFF (Backend for Frontend).
Expand Down
11 changes: 9 additions & 2 deletions UbikLink.AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
var serviceBus = builder.AddConnectionString("messaging");

//RabbitMQ (local)
var rabbitmq = builder.AddRabbitMQ("ubiklink-rabbitmq", rabbitUser, rabbitPassword)
var rabbitmq = builder.AddRabbitMQ("ubiklink-rabbitmq", rabbitUser, rabbitPassword, 58842)
.WithManagementPlugin()
.WithLifetime(ContainerLifetime.Persistent);

Expand All @@ -42,7 +42,7 @@
//var cache = builder.AddAzureRedis("cache");

//Redis cache (local)
var cache = builder.AddRedis("cache")
var cache = builder.AddRedis("cache", 6379)
.WithLifetime(ContainerLifetime.Persistent);

//Security API
Expand Down Expand Up @@ -101,4 +101,11 @@
.WithEnvironment("Messaging__RabbitUser", rabbitUser)
.WithEnvironment("Messaging__RabbitPassword", rabbitPassword);

//Add npm sevltekit project (not work with fnm.... because of path)
//builder.AddNpmApp("svelte-ui", "../svelte-link-ui","dev")
// .WithEnvironment("BROWSER", "none")
// .WithHttpEndpoint(env: "PORT")
// .WithExternalHttpEndpoints()
// .PublishAsDockerFile();

await builder.Build().RunAsync();
2 changes: 1 addition & 1 deletion UbikLink.AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"https": {
"commandName": "Project",
"launchBrowser": false,
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
Expand Down
2 changes: 1 addition & 1 deletion UbikLink.AppHost/Realm/ubik-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"realm": "ubik",
"notBefore": 0,
"defaultSignatureAlgorithm": "RS256",
"revokeRefreshToken": false,
"revokeRefreshToken": true,
"refreshTokenMaxReuse": 0,
"accessTokenLifespan": 660,
"accessTokenLifespanForImplicitFlow": 900,
Expand Down
1 change: 1 addition & 0 deletions UbikLink.AppHost/UbikLink.AppHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageReference Include="Aspire.Hosting.Azure.Redis" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.Azure.ServiceBus" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.Keycloak" Version="9.0.0-preview.5.24551.3" />
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.RabbitMQ" Version="9.0.0" />
<PackageReference Include="Aspire.Hosting.Redis" Version="9.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion UbikLink.Security.UI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchBrowser": false,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7043;http://localhost:5076",
"environmentVariables": {
Expand Down
Binary file modified best-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions svelte-link-ui/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
OIDC_ISSUER=http://localhost:8080/realms/ubik
OIDC_CLIENT_ID=ubik_app
OIDC_CLIENT_SECRET=Ye6Y36ocA4SaGqYzd0HgmqMhVaM2jlkE
OIDC_AUDIENCE=account
OIDC_REDIRECT_URI=http://localhost:5173/login/auth/callback
REDIS_PORT=6379
REDIS_HOST=localhost
BACKEND_PROXY_URL=http://localhost:5235
TOKEN_STORE_SECRET=Ye6Y36ocA4SaGqYzd0babaHgmqMhVaM2jlkE
RABBIT_MQ_CONNECTION=amqp://guest:guest@localhost:58842
23 changes: 23 additions & 0 deletions svelte-link-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions svelte-link-ui/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 4 additions & 0 deletions svelte-link-ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
16 changes: 16 additions & 0 deletions svelte-link-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"tailwindStylesheet": "./src/app.css",
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
1 change: 1 addition & 0 deletions svelte-link-ui/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 2 additions & 0 deletions svelte-link-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# sv

34 changes: 34 additions & 0 deletions svelte-link-ui/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import { fileURLToPath } from 'node:url';
import ts from 'typescript-eslint';
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));

export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],

languageOptions: {
parserOptions: {
parser: ts.parser
}
}
}
);
Loading