@authup/client-web-kit 1.0.0-beta.23 → 1.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/permission/APermissionCheck.d.ts +1 -1
- package/dist/components/permission/APermissionCheck.d.ts.map +1 -1
- package/dist/composables/use-permission-check.d.ts +1 -1
- package/dist/composables/use-permission-check.d.ts.map +1 -1
- package/dist/core/permission-check/types.d.ts +1 -1
- package/dist/core/permission-check/types.d.ts.map +1 -1
- package/dist/core/resource/socket/module.d.ts.map +1 -1
- package/dist/core/resource/socket/type.d.ts +1 -2
- package/dist/core/resource/socket/type.d.ts.map +1 -1
- package/dist/core/store/create.d.ts +4 -4
- package/dist/core/store/create.d.ts.map +1 -1
- package/dist/index.cjs +18 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -12
- package/dist/security/index.d.ts +0 -2
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/policy/index.d.ts +0 -3
- package/dist/security/policy/index.d.ts.map +0 -1
- package/dist/security/policy/module.d.ts +0 -5
- package/dist/security/policy/module.d.ts.map +0 -1
- package/dist/security/policy/variants/evaluator.d.ts +0 -11
- package/dist/security/policy/variants/evaluator.d.ts.map +0 -1
- package/dist/security/policy/variants/index.d.ts +0 -2
- package/dist/security/policy/variants/index.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -2,10 +2,12 @@ import { REALM_MASTER_NAME, DomainEventName, buildDomainChannelName, DomainType,
|
|
|
2
2
|
import { hasInjectionContext, inject as inject$2, provide as provide$1, ref, computed, getCurrentScope, onScopeDispose, toRaw, isRef, isReactive, toRef, unref, h, onMounted, onUnmounted, watch, shallowRef, watchEffect, defineComponent, reactive, nextTick, resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createBlock, withCtx, normalizeClass, withModifiers, toDisplayString, getCurrentInstance, resolveDynamicComponent, mergeProps } from 'vue';
|
|
3
3
|
import { Client, isClientTokenExpiredError, CookieName, ClientResponseErrorTokenHook } from '@authup/core-http-kit';
|
|
4
4
|
import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { PermissionMemoryProvider, PermissionChecker, PolicyEngine } from '@authup/access';
|
|
6
|
+
import { TokenError, isOpenIDProviderMetadata } from '@authup/specs';
|
|
7
|
+
import { merge, isObject as isObject$1, createMerger } from 'smob';
|
|
8
|
+
import { hasOwnProperty, createNanoID, isObject as isObject$2 } from '@authup/kit';
|
|
7
9
|
import { buildList, SlotName } from '@vuecs/list-controls';
|
|
8
|
-
import { ClientManager } from '@authup/core-realtime-kit';
|
|
10
|
+
import { ClientManager, buildEventFullName, EventNameSuffix } from '@authup/core-realtime-kit';
|
|
9
11
|
import { SortDirection } from 'rapiq';
|
|
10
12
|
import { buildFormSubmit, buildFormGroup, buildFormInput, buildFormTextarea, buildFormInputCheckbox, buildFormInputText } from '@vuecs/form-controls';
|
|
11
13
|
import { useTranslationsForBaseValidation as useTranslationsForBaseValidation$1, useTranslationsForNestedValidations, getSeverity, install as install$1 } from '@ilingo/vuelidate';
|
|
@@ -61,35 +63,6 @@ function injectHTTPClient(app) {
|
|
|
61
63
|
* view the LICENSE file that was distributed with this source code.
|
|
62
64
|
*/ const STORE_ID = 'authup';
|
|
63
65
|
|
|
64
|
-
class PermissionBindingPolicyEvaluator {
|
|
65
|
-
async can(ctx) {
|
|
66
|
-
return ctx.spec.type === BuiltInPolicyType.PERMISSION_BINDING;
|
|
67
|
-
}
|
|
68
|
-
async validateSpecification(ctx) {
|
|
69
|
-
return this.validator.run(ctx.spec);
|
|
70
|
-
}
|
|
71
|
-
async validateData(ctx) {
|
|
72
|
-
if (!isObject$1(ctx.data.identity) && !isObject$1(ctx.data.permission)) {
|
|
73
|
-
throw PolicyError.evaluatorContextInvalid();
|
|
74
|
-
}
|
|
75
|
-
return ctx.data;
|
|
76
|
-
}
|
|
77
|
-
async evaluate(ctx) {
|
|
78
|
-
// todo: this must be changed when the permission-checker not only checks owned permissions.
|
|
79
|
-
return maybeInvertPolicyOutcome(true, ctx.spec.invert);
|
|
80
|
-
}
|
|
81
|
-
constructor(){
|
|
82
|
-
this.validator = new PermissionBindingPolicyValidator();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
class PolicyEngine extends PolicyEngine$1 {
|
|
87
|
-
constructor(){
|
|
88
|
-
super();
|
|
89
|
-
this.registerEvaluator(BuiltInPolicyType.PERMISSION_BINDING, new PermissionBindingPolicyEvaluator());
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
66
|
/*
|
|
94
67
|
* Copyright (c) 2024.
|
|
95
68
|
* Author Peter Placzek (tada5hi)
|
|
@@ -390,7 +363,7 @@ function createStore(context) {
|
|
|
390
363
|
const loggedIn = computed(()=>!!accessToken.value);
|
|
391
364
|
const login = async (ctx)=>{
|
|
392
365
|
context.dispatcher.emit(StoreDispatcherEventName.LOGGING_IN);
|
|
393
|
-
const response = await client.token.
|
|
366
|
+
const response = await client.token.createWithPassword({
|
|
394
367
|
username: ctx.name,
|
|
395
368
|
password: ctx.password,
|
|
396
369
|
...realmId.value ? {
|
|
@@ -1914,7 +1887,7 @@ function computedAsync(evaluationCallback, initialState, optionsOrRef) {
|
|
|
1914
1887
|
} else {
|
|
1915
1888
|
options = {};
|
|
1916
1889
|
}
|
|
1917
|
-
const { lazy = false, evaluating =
|
|
1890
|
+
const { lazy = false, evaluating = undefined, shallow = true, onError = noop } = options;
|
|
1918
1891
|
const started = ref(!lazy);
|
|
1919
1892
|
const current = shallow ? shallowRef(initialState) : ref(initialState);
|
|
1920
1893
|
let counter = 0;
|
|
@@ -4460,7 +4433,7 @@ const AIdentityProviderOAuth2Discovery = defineComponent({
|
|
|
4460
4433
|
}
|
|
4461
4434
|
try {
|
|
4462
4435
|
const response = await apiClient.get(form.url);
|
|
4463
|
-
if (
|
|
4436
|
+
if (isOpenIDProviderMetadata(response.data)) {
|
|
4464
4437
|
setup.emit('lookup', response.data);
|
|
4465
4438
|
lookupValid.value = true;
|
|
4466
4439
|
}
|