@tachybase/plugin-auth-oidc 1.3.16 → 1.3.17

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.
@@ -1,3 +1,3 @@
1
- (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("antd"),require("react-router-dom"),require("react-i18next"),require("@tachybase/components"),require("@tachybase/schema")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","react","@ant-design/icons","antd","react-router-dom","react-i18next","@tachybase/components","@tachybase/schema"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["@tachybase/plugin-auth-oidc"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.react,e["@ant-design/icons"],e.antd,e["react-router-dom"],e["react-i18next"],e["@tachybase/components"],e["@tachybase/schema"]))})(this,function(e,o,l,a,u,x,c,h,n,m,P){"use strict";var v=(e,o,l)=>new Promise((a,u)=>{var x=n=>{try{h(l.next(n))}catch(m){u(m)}},c=n=>{try{h(l.throw(n))}catch(m){u(m)}},h=n=>n.done?a(n.value):Promise.resolve(n.value).then(x,c);h((l=l.apply(e,o)).next())});const k="OIDC",f="oidc";function t(r){return o.i18n.t(r,{ns:f})}function S(){return n.useTranslation(f)}const C=({authenticator:r})=>{const{t:d}=S(),b=o.useAPIClient(),I=h.useLocation(),i=new URLSearchParams(I.search),y=i.get("redirect"),g=()=>v(this,null,function*(){var F;const s=yield b.request({method:"post",url:"oidc:getAuthUrl",headers:{"X-Authenticator":r.name},data:{redirect:y}}),p=(F=s==null?void 0:s.data)==null?void 0:F.data;window.location.replace(p)});return u.useEffect(()=>{const s=i.get("authenticator"),p=i.get("error");if(s===r.name&&p){c.message.error(d(p));return}}),a.jsx(c.Space,{direction:"vertical",className:o.css`
1
+ (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("antd"),require("react-router-dom"),require("react-i18next"),require("@tachybase/components"),require("@tachybase/schema")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","react","@ant-design/icons","antd","react-router-dom","react-i18next","@tachybase/components","@tachybase/schema"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["@tachybase/plugin-auth-oidc"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.react,e["@ant-design/icons"],e.antd,e["react-router-dom"],e["react-i18next"],e["@tachybase/components"],e["@tachybase/schema"]))})(this,function(e,o,l,a,u,x,c,h,n,m,P){"use strict";var v=(e,o,l)=>new Promise((a,u)=>{var x=n=>{try{h(l.next(n))}catch(m){u(m)}},c=n=>{try{h(l.throw(n))}catch(m){u(m)}},h=n=>n.done?a(n.value):Promise.resolve(n.value).then(x,c);h((l=l.apply(e,o)).next())});const k="OIDC",f="oidc";function t(r){return o.i18n.t(r,{ns:f})}function S(){return n.useTranslation(f)}const C=({authenticator:r})=>{const{t:d}=S(),b=o.useAPIClient(),I=h.useLocation(),i=new URLSearchParams(I.search),y=i.get("redirect"),g=()=>v(null,null,function*(){var F;const s=yield b.request({method:"post",url:"oidc:getAuthUrl",headers:{"X-Authenticator":r.name},data:{redirect:y}}),p=(F=s==null?void 0:s.data)==null?void 0:F.data;window.location.replace(p)});return u.useEffect(()=>{const s=i.get("authenticator"),p=i.get("error");if(s===r.name&&p){c.message.error(d(p));return}}),a.jsx(c.Space,{direction:"vertical",className:o.css`
2
2
  display: flex;
3
3
  `,children:a.jsx(c.Button,{shape:"round",block:!0,icon:a.jsx(x.LoginOutlined,{}),onClick:g,children:d(r.title)})})},A={type:"object",properties:{public:{type:"object",properties:{autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox",default:!0}}},oidc:{type:"object",properties:{collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:t("Basic configuration")},properties:{issuer:{type:"string",title:'{{t("Issuer")}}',"x-component":"Input","x-decorator":"FormItem",required:!0},clientId:{type:"string",title:'{{t("Client ID")}}',"x-component":"Input","x-decorator":"FormItem",required:!0},clientSecret:{type:"string",title:'{{t("Client Secret")}}',"x-component":"Input","x-decorator":"FormItem",required:!0},scope:{type:"string",title:'{{t("scope")}}',"x-component":"Input","x-decorator":"FormItem","x-decorator-props":{tooltip:'{{t("Default: openid profile email")}}'}},idTokenSignedResponseAlg:{type:"string",title:'{{t("id_token signed response algorithm")}}',"x-component":"Select","x-decorator":"FormItem",enum:[{label:"HS256",value:"HS256"},{label:"HS384",value:"HS384"},{label:"HS512",value:"HS512"},{label:"RS256",value:"RS256"},{label:"RS384",value:"RS384"},{label:"RS512",value:"RS512"},{label:"ES256",value:"ES256"},{label:"ES384",value:"ES384"},{label:"ES512",value:"ES512"},{label:"PS256",value:"PS256"},{label:"PS384",value:"PS384"},{label:"PS512",value:"PS512"}]}}},mapping:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:t("Field mapping")},properties:{fieldMap:{title:'{{t("Field Map")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayItems",items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{source:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("source")}}'}},target:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{placeholder:'{{t("target")}}'},enum:[{label:t("Nickname"),value:"nickname"},{label:t("Email"),value:"email"},{label:t("Phone"),value:"phone"},{label:t("Username"),value:"username"}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:"Add","x-component":"ArrayItems.Addition"}}},userBindField:{type:"string",title:'{{t("Use this field to bind the user")}}',"x-component":"Select","x-decorator":"FormItem",default:"email",enum:[{label:t("Email"),value:"email"},{label:t("Username"),value:"username"}],required:!0}}},advanced:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:t("Advanced configuration")},properties:{http:{type:"boolean",title:'{{t("HTTP")}}',"x-component":"Checkbox","x-decorator":"FormItem","x-decorator-props":{tooltip:'{{t("Check if TachyBase is running on HTTP protocol")}}'}},port:{type:"number",title:'{{t("Port")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-decorator-props":{tooltip:'{{t("The port number of the TachyBase service if it is not 80 or 443")}}'},"x-component-props":{style:{width:"15%",minWidth:"100px"}}},stateToken:{type:"string",title:'{{t("State token")}}',"x-component":"Input","x-decorator":"FormItem",description:t("The state token helps prevent CSRF attacks. It's recommended to leave it blank for automatic random generation.")},exchangeBodyKeys:{type:"array",title:'{{t("Pass parameters in the authorization code grant exchange")}}',"x-decorator":"FormItem","x-component":"ArrayItems",default:[{paramName:"",optionsKey:"clientId"},{paramName:"",optionsKey:"clientSecret"}],items:{type:"object","x-decorator":"ArrayItems.Item",properties:{space:{type:"void","x-component":"Space",properties:{enabled:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox"},optionsKey:{type:"string","x-decorator":"FormItem","x-decorator-props":{style:{width:"100px"}},"x-component":"Select","x-read-pretty":!0,enum:[{label:t("Client ID"),value:"clientId"},{label:t("Client Secret"),value:"clientSecret"}]},paramName:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Parameter name")}}'}}}}}}},userInfoMethod:{type:"string",title:'{{t("Method to call the user info endpoint")}}',"x- decorator":"FormItem","x-component":"Radio.Group",default:"GET",enum:[{label:"GET",value:"GET"},{label:"POST",value:"POST"}],"x-reactions":[{dependencies:[".accessTokenVia"],when:'{{$deps[0] === "query"}}',fulfill:{state:{value:"GET"}}},{dependencies:[".accessTokenVia"],when:'{{$deps[0] === "body"}}',fulfill:{state:{value:"POST"}}}]},accessTokenVia:{type:"string",title:'{{t("Where to put the access token when calling the user info endpoint")}}',"x- decorator":"FormItem","x-component":"Radio.Group",default:"header",enum:[{label:t("Header"),value:"header"},{label:t("Body (Use with POST method)"),value:"body"},{label:t("Query parameters (Use with GET method)"),value:"query"}]}}}}}}},usage:{type:"void","x-component":"Usage"}}},q=P.observer(()=>{const{t:r}=S(),d=o.useApp(),b=u.useMemo(()=>{var p;const i=d.getOptions(),y=(p=i==null?void 0:i.apiClient)==null?void 0:p.baseURL,{protocol:g,host:s}=window.location;return y.startsWith("http")?`${y}oidc:redirect`:`${g}//${s}${y}oidc:redirect`},[d]),I=i=>{navigator.clipboard.writeText(i),c.message.success(r("Copied"))};return a.jsx(c.Card,{title:r("Usage"),type:"inner",children:a.jsx(o.FormItem,{label:r("Redirect URL"),children:a.jsx(o.Input,{value:b,disabled:!0,addonBefore:a.jsx(x.CopyOutlined,{onClick:()=>I(b)})})})})},{displayName:"Usage"}),E=()=>{const{t:r}=S();return a.jsx(o.SchemaComponent,{scope:{t:r},components:{Usage:q,ArrayItems:m.ArrayItems,Space:c.Space,FormTab:m.FormTab},schema:A})};class T extends o.Plugin{load(){return v(this,null,function*(){this.app.pm.get(l).registerType(k,{components:{SignInButton:C,AdminSettingsForm:E}})})}}e.OidcPlugin=T,e.default=T,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,14 +1,14 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.16",
4
- "@tachybase/module-auth": "1.3.16",
3
+ "@tachybase/client": "1.3.17",
4
+ "@tachybase/module-auth": "1.3.17",
5
5
  "@ant-design/icons": "5.3.7",
6
6
  "antd": "5.22.5",
7
7
  "react-router-dom": "6.28.1",
8
- "@tachybase/components": "1.3.16",
9
- "@tachybase/schema": "1.3.16",
10
- "@tachybase/auth": "1.3.16",
11
- "@tachybase/server": "1.3.16",
8
+ "@tachybase/components": "1.3.17",
9
+ "@tachybase/schema": "1.3.17",
10
+ "@tachybase/auth": "1.3.17",
11
+ "@tachybase/server": "1.3.17",
12
12
  "react-i18next": "15.2.0",
13
- "@tachybase/actions": "1.3.16"
13
+ "@tachybase/actions": "1.3.17"
14
14
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"name":"nanoid","version":"3.3.8","description":"A tiny (116 bytes), secure URL-friendly unique string ID generator","keywords":["uuid","random","id","url"],"engines":{"node":"^10 || ^12 || ^13.7 || ^14 || >=15.0.1"},"funding":[{"type":"github","url":"https://github.com/sponsors/ai"}],"author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT","repository":"ai/nanoid","browser":{"./index.js":"./index.browser.js","./async/index.js":"./async/index.browser.js","./async/index.cjs":"./async/index.browser.cjs","./index.cjs":"./index.browser.cjs"},"react-native":"index.js","bin":"./bin/nanoid.cjs","sideEffects":false,"types":"./index.d.ts","type":"module","main":"index.cjs","module":"index.js","exports":{".":{"browser":"./index.browser.js","require":{"types":"./index.d.cts","default":"./index.cjs"},"import":{"types":"./index.d.ts","default":"./index.js"},"default":"./index.js"},"./package.json":"./package.json","./async/package.json":"./async/package.json","./async":{"browser":"./async/index.browser.js","require":{"types":"./index.d.cts","default":"./async/index.cjs"},"import":{"types":"./index.d.ts","default":"./async/index.js"},"default":"./async/index.js"},"./non-secure/package.json":"./non-secure/package.json","./non-secure":{"require":{"types":"./index.d.cts","default":"./non-secure/index.cjs"},"import":{"types":"./index.d.ts","default":"./non-secure/index.js"},"default":"./non-secure/index.js"},"./url-alphabet/package.json":"./url-alphabet/package.json","./url-alphabet":{"require":{"types":"./index.d.cts","default":"./url-alphabet/index.cjs"},"import":{"types":"./index.d.ts","default":"./url-alphabet/index.js"},"default":"./url-alphabet/index.js"}},"_lastModified":"2025-07-02T03:52:48.091Z"}
1
+ {"name":"nanoid","version":"3.3.8","description":"A tiny (116 bytes), secure URL-friendly unique string ID generator","keywords":["uuid","random","id","url"],"engines":{"node":"^10 || ^12 || ^13.7 || ^14 || >=15.0.1"},"funding":[{"type":"github","url":"https://github.com/sponsors/ai"}],"author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT","repository":"ai/nanoid","browser":{"./index.js":"./index.browser.js","./async/index.js":"./async/index.browser.js","./async/index.cjs":"./async/index.browser.cjs","./index.cjs":"./index.browser.cjs"},"react-native":"index.js","bin":"./bin/nanoid.cjs","sideEffects":false,"types":"./index.d.ts","type":"module","main":"index.cjs","module":"index.js","exports":{".":{"browser":"./index.browser.js","require":{"types":"./index.d.cts","default":"./index.cjs"},"import":{"types":"./index.d.ts","default":"./index.js"},"default":"./index.js"},"./package.json":"./package.json","./async/package.json":"./async/package.json","./async":{"browser":"./async/index.browser.js","require":{"types":"./index.d.cts","default":"./async/index.cjs"},"import":{"types":"./index.d.ts","default":"./async/index.js"},"default":"./async/index.js"},"./non-secure/package.json":"./non-secure/package.json","./non-secure":{"require":{"types":"./index.d.cts","default":"./non-secure/index.cjs"},"import":{"types":"./index.d.ts","default":"./non-secure/index.js"},"default":"./non-secure/index.js"},"./url-alphabet/package.json":"./url-alphabet/package.json","./url-alphabet":{"require":{"types":"./index.d.cts","default":"./url-alphabet/index.cjs"},"import":{"types":"./index.d.ts","default":"./url-alphabet/index.js"},"default":"./url-alphabet/index.js"}},"_lastModified":"2025-07-04T04:00:11.838Z"}
@@ -1 +1 @@
1
- {"name":"openid-client","version":"5.7.1","description":"OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs","keywords":["auth","authentication","basic","certified","client","connect","dynamic","electron","hybrid","identity","implicit","oauth","oauth2","oidc","openid","passport","relying party","strategy"],"homepage":"https://github.com/panva/openid-client","repository":"panva/openid-client","funding":{"url":"https://github.com/sponsors/panva"},"license":"MIT","author":"Filip Skokan <panva.ip@gmail.com>","exports":{"types":"./types/index.d.ts","import":"./lib/index.mjs","require":"./lib/index.js"},"main":"./lib/index.js","types":"./types/index.d.ts","files":["lib","types/index.d.ts"],"scripts":{"format":"npx prettier --loglevel silent --write ./lib ./test ./certification ./types","test":"mocha test/**/*.test.js"},"dependencies":{"jose":"^4.15.9","lru-cache":"^6.0.0","object-hash":"^2.2.0","oidc-token-hash":"^5.0.3"},"devDependencies":{"@types/node":"^16.18.106","@types/passport":"^1.0.16","base64url":"^3.0.1","chai":"^4.5.0","mocha":"^10.7.3","nock":"^13.5.5","prettier":"^2.8.8","readable-mock-req":"^0.2.2","sinon":"^9.2.4","timekeeper":"^2.3.1"},"standard-version":{"scripts":{"postchangelog":"sed -i '' -e 's/### \\[/## [/g' CHANGELOG.md"},"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Fixes"},{"type":"chore","hidden":true},{"type":"docs","hidden":true},{"type":"style","hidden":true},{"type":"refactor","section":"Refactor","hidden":false},{"type":"perf","section":"Performance","hidden":false},{"type":"test","hidden":true}]},"_lastModified":"2025-07-02T03:52:48.012Z"}
1
+ {"name":"openid-client","version":"5.7.1","description":"OpenID Connect Relying Party (RP, Client) implementation for Node.js runtime, supports passportjs","keywords":["auth","authentication","basic","certified","client","connect","dynamic","electron","hybrid","identity","implicit","oauth","oauth2","oidc","openid","passport","relying party","strategy"],"homepage":"https://github.com/panva/openid-client","repository":"panva/openid-client","funding":{"url":"https://github.com/sponsors/panva"},"license":"MIT","author":"Filip Skokan <panva.ip@gmail.com>","exports":{"types":"./types/index.d.ts","import":"./lib/index.mjs","require":"./lib/index.js"},"main":"./lib/index.js","types":"./types/index.d.ts","files":["lib","types/index.d.ts"],"scripts":{"format":"npx prettier --loglevel silent --write ./lib ./test ./certification ./types","test":"mocha test/**/*.test.js"},"dependencies":{"jose":"^4.15.9","lru-cache":"^6.0.0","object-hash":"^2.2.0","oidc-token-hash":"^5.0.3"},"devDependencies":{"@types/node":"^16.18.106","@types/passport":"^1.0.16","base64url":"^3.0.1","chai":"^4.5.0","mocha":"^10.7.3","nock":"^13.5.5","prettier":"^2.8.8","readable-mock-req":"^0.2.2","sinon":"^9.2.4","timekeeper":"^2.3.1"},"standard-version":{"scripts":{"postchangelog":"sed -i '' -e 's/### \\[/## [/g' CHANGELOG.md"},"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Fixes"},{"type":"chore","hidden":true},{"type":"docs","hidden":true},{"type":"style","hidden":true},{"type":"refactor","section":"Refactor","hidden":false},{"type":"perf","section":"Performance","hidden":false},{"type":"test","hidden":true}]},"_lastModified":"2025-07-04T04:00:11.763Z"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-auth-oidc",
3
3
  "displayName": "Auth: OIDC",
4
- "version": "1.3.16",
4
+ "version": "1.3.17",
5
5
  "description": "OIDC (OpenID Connect) authentication.",
6
6
  "keywords": [
7
7
  "Authentication"
@@ -18,17 +18,17 @@
18
18
  "react": "~18.3.1",
19
19
  "react-i18next": "^15.2.0",
20
20
  "react-router-dom": "6.28.1",
21
- "@tachybase/components": "1.3.16",
22
- "@tachybase/schema": "1.3.16"
21
+ "@tachybase/components": "1.3.17",
22
+ "@tachybase/schema": "1.3.17"
23
23
  },
24
24
  "peerDependencies": {
25
- "@tachybase/actions": "1.3.16",
26
- "@tachybase/client": "1.3.16",
27
- "@tachybase/database": "1.3.16",
28
- "@tachybase/auth": "1.3.16",
29
- "@tachybase/module-auth": "1.3.16",
30
- "@tachybase/server": "1.3.16",
31
- "@tachybase/test": "1.3.16"
25
+ "@tachybase/auth": "1.3.17",
26
+ "@tachybase/database": "1.3.17",
27
+ "@tachybase/client": "1.3.17",
28
+ "@tachybase/module-auth": "1.3.17",
29
+ "@tachybase/actions": "1.3.17",
30
+ "@tachybase/server": "1.3.17",
31
+ "@tachybase/test": "1.3.17"
32
32
  },
33
33
  "description.zh-CN": "通过 OIDC (OpenID Connect) 协议认证身份。",
34
34
  "displayName.zh-CN": "认证:OIDC",