Skip to content

Commit 0309965

Browse files
update lockr for new endpoint methods
1 parent b50f51f commit 0309965

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

crates/common/src/integrations/lockr.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,12 @@ pub fn register(settings: &Settings) -> Option<IntegrationRegistration> {
311311

312312
#[async_trait(?Send)]
313313
impl IntegrationProxy for LockrIntegration {
314+
fn integration_name(&self) -> &'static str {
315+
LOCKR_INTEGRATION_ID
316+
}
317+
314318
fn routes(&self) -> Vec<IntegrationEndpoint> {
315-
vec![
316-
// SDK serving
317-
IntegrationEndpoint::get("/integrations/lockr/sdk"),
318-
// API proxy endpoints
319-
IntegrationEndpoint::post("/integrations/lockr/api/*"),
320-
IntegrationEndpoint::get("/integrations/lockr/api/*"),
321-
]
319+
vec![self.get("/sdk"), self.post("/api/*"), self.get("/api/*")]
322320
}
323321

324322
async fn handle(

crates/js/lib/test/integrations/lockr/nextjs_guard.test.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
2-
import { installNextJsGuard, isGuardInstalled, resetGuardState } from '../../../src/integrations/lockr/nextjs_guard';
2+
import {
3+
installNextJsGuard,
4+
isGuardInstalled,
5+
resetGuardState,
6+
} from '../../../src/integrations/lockr/nextjs_guard';
37

48
describe('Lockr SDK Script Interception Guard', () => {
59
let originalAppendChild: typeof Element.prototype.appendChild;
@@ -113,7 +117,7 @@ describe('Lockr SDK Script Interception Guard', () => {
113117

114118
const container = document.createElement('div');
115119
const script = document.createElement('script');
116-
120+
117121
script.src = 'https://aim.loc.kr/identity-lockr-v1.0.js';
118122

119123
container.appendChild(script);
@@ -242,7 +246,7 @@ describe('Lockr SDK Script Interception Guard', () => {
242246

243247
const container = document.createElement('div');
244248
const script = document.createElement('script');
245-
249+
246250
script.src = 'https://aim.loc.kr/identity-lockr-v1.0.js';
247251

248252
container.appendChild(script);
@@ -255,7 +259,7 @@ describe('Lockr SDK Script Interception Guard', () => {
255259

256260
const container = document.createElement('div');
257261
const script = document.createElement('script');
258-
262+
259263
script.src = 'https://identity.loc.kr/identity-lockr-v2.0.js';
260264

261265
container.appendChild(script);
@@ -268,7 +272,7 @@ describe('Lockr SDK Script Interception Guard', () => {
268272

269273
const container = document.createElement('div');
270274
const script = document.createElement('script');
271-
275+
272276
script.src = 'https://AIM.LOC.KR/identity-lockr-v1.0.js';
273277

274278
container.appendChild(script);
@@ -281,7 +285,7 @@ describe('Lockr SDK Script Interception Guard', () => {
281285

282286
const container = document.createElement('div');
283287
const script = document.createElement('script');
284-
288+
285289
script.src = 'https://identity.loc.kr/other-script.js';
286290

287291
container.appendChild(script);
@@ -294,7 +298,7 @@ describe('Lockr SDK Script Interception Guard', () => {
294298

295299
const container = document.createElement('div');
296300
const script = document.createElement('script');
297-
301+
298302
script.src = 'https://identity.loc.kr/identity-lockr-v1.0.css';
299303

300304
container.appendChild(script);
@@ -527,7 +531,7 @@ describe('Lockr SDK Script Interception Guard', () => {
527531

528532
// Add script tag
529533
const script = document.createElement('script');
530-
534+
531535
script.src = 'https://aim.loc.kr/identity-lockr-v1.0.js';
532536

533537
container.appendChild(link);

0 commit comments

Comments
 (0)