Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
release: SnapCAD Studio 1.0.11 (Mimari BIM & Metraj Studyosu, IFC4 ihraci, canli guncelleme ilerlemesi, YakNet SSO iyilestirmesi)
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
Build and Push Docker Images / build (push) Canceled after 0s
Desktop Release / Build linux desktop (push) Canceled after 0s
Desktop Release / Build windows desktop (push) Canceled after 0s
Desktop Release / Attach packages to release (push) Canceled after 0s
CI / Typecheck and unit tests (push) Canceled after 0s
Desktop Release / Build macos desktop (push) Canceled after 0s
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
computeUserInitials,
|
||||
resolveYakNetWidgetAttributes,
|
||||
sanitizeYakNetWidgetUser,
|
||||
shouldSuppressUnauthenticatedSsoMessage,
|
||||
YAKNET_ACCOUNT_CDN_URL,
|
||||
YAKNET_AUTH_BASE,
|
||||
YAKNET_SSO_IFRAME_ID,
|
||||
} from "../../apps/web/src/lib/yaknetWidgetHelpers";
|
||||
|
||||
describe("YakNet SSO Cross-Subdomain Real-Time Session Synchronization", () => {
|
||||
it("validates incoming YAKNET_SSO_STATUS message payload structure", () => {
|
||||
@@ -80,10 +91,97 @@ describe("YakNet SSO Cross-Subdomain Real-Time Session Synchronization", () => {
|
||||
});
|
||||
|
||||
it("ensures correct auth base URL for YakNet developer console SSO frame", () => {
|
||||
const YAKNET_AUTH_BASE = "https://developer-console.yakhub.com.tr";
|
||||
const ssoFrameUrl = `${YAKNET_AUTH_BASE}/sdk/sso-frame`;
|
||||
|
||||
expect(ssoFrameUrl).toBe("https://developer-console.yakhub.com.tr/sdk/sso-frame");
|
||||
expect(ssoFrameUrl.startsWith("https://developer-console.yakhub.com.tr")).toBe(true);
|
||||
});
|
||||
|
||||
it("omits authenticated attribute until session resolves to prevent login-button flash", () => {
|
||||
const unresolvedAttrs = resolveYakNetWidgetAttributes({
|
||||
user: null,
|
||||
sessionResolved: false,
|
||||
theme: "light",
|
||||
});
|
||||
expect(unresolvedAttrs.authenticated).toBeNull();
|
||||
expect(unresolvedAttrs["user-name"]).toBeNull();
|
||||
|
||||
const signedOutAttrs = resolveYakNetWidgetAttributes({
|
||||
user: null,
|
||||
sessionResolved: true,
|
||||
});
|
||||
expect(signedOutAttrs.authenticated).toBe("false");
|
||||
|
||||
const signedInAttrs = resolveYakNetWidgetAttributes({
|
||||
user: { id: 7, name: "Yakup İpek", email: "[email protected]" },
|
||||
sessionResolved: true,
|
||||
});
|
||||
expect(signedInAttrs.authenticated).toBe("true");
|
||||
expect(signedInAttrs["user-name"]).toBe("Yakup İpek");
|
||||
expect(signedInAttrs["user-email"]).toBe("[email protected]");
|
||||
});
|
||||
|
||||
it("suppresses stale or cookie-less unauthenticated SSO frame messages safely", () => {
|
||||
expect(
|
||||
shouldSuppressUnauthenticatedSsoMessage({
|
||||
isDesktop: true,
|
||||
sessionResolved: true,
|
||||
hasAuthenticatedUser: true,
|
||||
ssoFrameHadAuthenticated: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
shouldSuppressUnauthenticatedSsoMessage({
|
||||
isDesktop: false,
|
||||
sessionResolved: false,
|
||||
hasAuthenticatedUser: false,
|
||||
ssoFrameHadAuthenticated: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
shouldSuppressUnauthenticatedSsoMessage({
|
||||
isDesktop: false,
|
||||
sessionResolved: true,
|
||||
hasAuthenticatedUser: true,
|
||||
ssoFrameHadAuthenticated: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
|
||||
expect(
|
||||
shouldSuppressUnauthenticatedSsoMessage({
|
||||
isDesktop: false,
|
||||
sessionResolved: true,
|
||||
hasAuthenticatedUser: true,
|
||||
ssoFrameHadAuthenticated: true,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("sanitizes YakNet widget users and computes avatar initials", () => {
|
||||
expect(sanitizeYakNetWidgetUser({ id: 0, name: "Invalid" })).toBeNull();
|
||||
expect(sanitizeYakNetWidgetUser({ id: 12, name: " Yakup İpek ", email: " [email protected] " })).toEqual({
|
||||
id: 12,
|
||||
name: "Yakup İpek",
|
||||
email: "[email protected]",
|
||||
avatar: null,
|
||||
auth_source: undefined,
|
||||
});
|
||||
expect(computeUserInitials("Yakup İpek")).toBe("Yİ");
|
||||
expect(computeUserInitials("Tekisim")).toBe("T");
|
||||
expect(computeUserInitials("")).toBe("YN");
|
||||
});
|
||||
|
||||
it("keeps yaknet-account widget dynamically loaded from CDN without vendoring", () => {
|
||||
const repoRoot = path.resolve(__dirname, "../..");
|
||||
const layoutSource = fs.readFileSync(path.join(repoRoot, "apps/web/src/app/layout.tsx"), "utf8");
|
||||
const cloudBarSource = fs.readFileSync(path.join(repoRoot, "apps/web/src/components/snapcad/YakNetCloudBar.tsx"), "utf8");
|
||||
|
||||
expect(YAKNET_ACCOUNT_CDN_URL).toBe("https://cdnjs.yakhub.com.tr/ajax/libs/yaknet-account/latest/yaknet-account.js");
|
||||
expect(layoutSource).toContain("YAKNET_ACCOUNT_CDN_URL");
|
||||
expect(cloudBarSource).toContain("YAKNET_SSO_IFRAME_ID");
|
||||
expect(YAKNET_SSO_IFRAME_ID).toBe("yaknet-sso-iframe-instance");
|
||||
expect(fs.existsSync(path.join(repoRoot, "apps/web/public/yaknet-account.js"))).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user