[{"data":1,"prerenderedAt":1713},["ShallowReactive",2],{"navigation_docs":3,"-developers-modules-oauth":613,"-developers-modules-oauth-surround":1710},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":447,"body":615,"description":678,"extension":1705,"links":1706,"meta":1707,"navigation":719,"path":448,"seo":1708,"stem":449,"__hash__":1709},"docs\u002F4.developers\u002F3.modules\u002F10.oauth.md",{"type":616,"value":617,"toc":1697},"minimark",[618,622,657,662,672,1161,1164,1213,1216,1220,1223,1230,1233,1237,1240,1361,1378,1392,1402,1406,1419,1521,1541,1544,1607,1611,1666,1670,1693],[619,620,621],"p",{},"A calendar, bookkeeping or mail module often works on someone's account at another service: their Google calendar,\ntheir Exact or Moneybird administration. Those services hand out access with OAuth2. SHADE runs the whole flow for\nyour module: an admin connects the account, SHADE keeps the tokens sealed, refreshes them before they end, seals them\nagain when the instance's secret is rotated and revokes them when your module is uninstalled. Your module only calls\nthe service's API.",[619,623,624,625,629,630,634,635,639,640,639,643,639,646,639,649,652,653,656],{},"The OAuth2 client is ",[626,627,628],"strong",{},"experimental"," in 0.1 (see ",[631,632,633],"a",{"href":444},"Experimental manifest parts","): the manifest\npart ",[636,637,638],"code",{},"oauth",", ",[636,641,642],{},"oauthFetch",[636,644,645],{},"oauthAccessToken",[636,647,648],{},"oauthAccounts",[636,650,651],{},"ModuleOAuthProvider"," and ",[636,654,655],{},"OAuthAccount"," may change\nin a minor version until a second, different module uses them. It is for trusted modules only.",[658,659,661],"h2",{"id":660},"naming-the-provider","Naming the provider",[619,663,664,665,667,668,671],{},"Declare each provider under its own name in ",[636,666,638],{},", with the client id and secret as settings (the secret as a\nsecret setting, so it is sealed), and give the hosts SHADE calls in your ",[636,669,670],{},"network"," capability:",[673,674,679],"pre",{"className":675,"code":676,"language":677,"meta":678,"style":678},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineModule } from '@shadestack\u002Fmodule-sdk\u002Fserver'\n\nexport default defineModule({\n  name: 'calendars-google',\n  \u002F\u002F …\n  capabilities: {\n    network: { hosts: ['oauth2.googleapis.com', 'www.googleapis.com'] }\n  },\n  settings: {\n    fields: [\n      { kind: 'text', name: 'clientId', label: 'Client id' },\n      { kind: 'text', name: 'clientSecret', label: 'Client secret' }\n    ],\n    secrets: ['clientSecret']\n  },\n  oauth: {\n    google: {\n      authorizeUrl: 'https:\u002F\u002Faccounts.google.com\u002Fo\u002Foauth2\u002Fv2\u002Fauth',\n      tokenUrl: 'https:\u002F\u002Foauth2.googleapis.com\u002Ftoken',\n      revokeUrl: 'https:\u002F\u002Foauth2.googleapis.com\u002Frevoke',\n      scopes: ['https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fcalendar.readonly'],\n      clientId: 'clientId',\n      clientSecret: 'clientSecret',\n      \u002F\u002F Google gives a refresh token only for offline access, and only when the person agrees again.\n      authorizeParams: { access_type: 'offline', prompt: 'consent' }\n    }\n  }\n})\n","ts","",[636,680,681,714,721,739,760,767,778,819,825,835,846,895,939,947,966,971,981,991,1008,1025,1042,1064,1080,1096,1102,1140,1146,1152],{"__ignoreMap":678},[682,683,686,690,694,698,701,704,707,711],"span",{"class":684,"line":685},"line",1,[682,687,689],{"class":688},"s7zQu","import",[682,691,693],{"class":692},"sMK4o"," {",[682,695,697],{"class":696},"sTEyZ"," defineModule",[682,699,700],{"class":692}," }",[682,702,703],{"class":688}," from",[682,705,706],{"class":692}," '",[682,708,710],{"class":709},"sfazB","@shadestack\u002Fmodule-sdk\u002Fserver",[682,712,713],{"class":692},"'\n",[682,715,717],{"class":684,"line":716},2,[682,718,720],{"emptyLinePlaceholder":719},true,"\n",[682,722,724,727,730,733,736],{"class":684,"line":723},3,[682,725,726],{"class":688},"export",[682,728,729],{"class":688}," default",[682,731,697],{"class":732},"s2Zo4",[682,734,735],{"class":696},"(",[682,737,738],{"class":692},"{\n",[682,740,742,746,749,751,754,757],{"class":684,"line":741},4,[682,743,745],{"class":744},"swJcz","  name",[682,747,748],{"class":692},":",[682,750,706],{"class":692},[682,752,753],{"class":709},"calendars-google",[682,755,756],{"class":692},"'",[682,758,759],{"class":692},",\n",[682,761,763],{"class":684,"line":762},5,[682,764,766],{"class":765},"sHwdD","  \u002F\u002F …\n",[682,768,770,773,775],{"class":684,"line":769},6,[682,771,772],{"class":744},"  capabilities",[682,774,748],{"class":692},[682,776,777],{"class":692}," {\n",[682,779,781,784,786,788,791,793,796,798,801,803,806,808,811,813,816],{"class":684,"line":780},7,[682,782,783],{"class":744},"    network",[682,785,748],{"class":692},[682,787,693],{"class":692},[682,789,790],{"class":744}," hosts",[682,792,748],{"class":692},[682,794,795],{"class":696}," [",[682,797,756],{"class":692},[682,799,800],{"class":709},"oauth2.googleapis.com",[682,802,756],{"class":692},[682,804,805],{"class":692},",",[682,807,706],{"class":692},[682,809,810],{"class":709},"www.googleapis.com",[682,812,756],{"class":692},[682,814,815],{"class":696},"] ",[682,817,818],{"class":692},"}\n",[682,820,822],{"class":684,"line":821},8,[682,823,824],{"class":692},"  },\n",[682,826,828,831,833],{"class":684,"line":827},9,[682,829,830],{"class":744},"  settings",[682,832,748],{"class":692},[682,834,777],{"class":692},[682,836,838,841,843],{"class":684,"line":837},10,[682,839,840],{"class":744},"    fields",[682,842,748],{"class":692},[682,844,845],{"class":696}," [\n",[682,847,849,852,855,857,859,862,864,866,869,871,873,876,878,880,883,885,887,890,892],{"class":684,"line":848},11,[682,850,851],{"class":692},"      {",[682,853,854],{"class":744}," kind",[682,856,748],{"class":692},[682,858,706],{"class":692},[682,860,861],{"class":709},"text",[682,863,756],{"class":692},[682,865,805],{"class":692},[682,867,868],{"class":744}," name",[682,870,748],{"class":692},[682,872,706],{"class":692},[682,874,875],{"class":709},"clientId",[682,877,756],{"class":692},[682,879,805],{"class":692},[682,881,882],{"class":744}," label",[682,884,748],{"class":692},[682,886,706],{"class":692},[682,888,889],{"class":709},"Client id",[682,891,756],{"class":692},[682,893,894],{"class":692}," },\n",[682,896,898,900,902,904,906,908,910,912,914,916,918,921,923,925,927,929,931,934,936],{"class":684,"line":897},12,[682,899,851],{"class":692},[682,901,854],{"class":744},[682,903,748],{"class":692},[682,905,706],{"class":692},[682,907,861],{"class":709},[682,909,756],{"class":692},[682,911,805],{"class":692},[682,913,868],{"class":744},[682,915,748],{"class":692},[682,917,706],{"class":692},[682,919,920],{"class":709},"clientSecret",[682,922,756],{"class":692},[682,924,805],{"class":692},[682,926,882],{"class":744},[682,928,748],{"class":692},[682,930,706],{"class":692},[682,932,933],{"class":709},"Client secret",[682,935,756],{"class":692},[682,937,938],{"class":692}," }\n",[682,940,942,945],{"class":684,"line":941},13,[682,943,944],{"class":696},"    ]",[682,946,759],{"class":692},[682,948,950,953,955,957,959,961,963],{"class":684,"line":949},14,[682,951,952],{"class":744},"    secrets",[682,954,748],{"class":692},[682,956,795],{"class":696},[682,958,756],{"class":692},[682,960,920],{"class":709},[682,962,756],{"class":692},[682,964,965],{"class":696},"]\n",[682,967,969],{"class":684,"line":968},15,[682,970,824],{"class":692},[682,972,974,977,979],{"class":684,"line":973},16,[682,975,976],{"class":744},"  oauth",[682,978,748],{"class":692},[682,980,777],{"class":692},[682,982,984,987,989],{"class":684,"line":983},17,[682,985,986],{"class":744},"    google",[682,988,748],{"class":692},[682,990,777],{"class":692},[682,992,994,997,999,1001,1004,1006],{"class":684,"line":993},18,[682,995,996],{"class":744},"      authorizeUrl",[682,998,748],{"class":692},[682,1000,706],{"class":692},[682,1002,1003],{"class":709},"https:\u002F\u002Faccounts.google.com\u002Fo\u002Foauth2\u002Fv2\u002Fauth",[682,1005,756],{"class":692},[682,1007,759],{"class":692},[682,1009,1011,1014,1016,1018,1021,1023],{"class":684,"line":1010},19,[682,1012,1013],{"class":744},"      tokenUrl",[682,1015,748],{"class":692},[682,1017,706],{"class":692},[682,1019,1020],{"class":709},"https:\u002F\u002Foauth2.googleapis.com\u002Ftoken",[682,1022,756],{"class":692},[682,1024,759],{"class":692},[682,1026,1028,1031,1033,1035,1038,1040],{"class":684,"line":1027},20,[682,1029,1030],{"class":744},"      revokeUrl",[682,1032,748],{"class":692},[682,1034,706],{"class":692},[682,1036,1037],{"class":709},"https:\u002F\u002Foauth2.googleapis.com\u002Frevoke",[682,1039,756],{"class":692},[682,1041,759],{"class":692},[682,1043,1045,1048,1050,1052,1054,1057,1059,1062],{"class":684,"line":1044},21,[682,1046,1047],{"class":744},"      scopes",[682,1049,748],{"class":692},[682,1051,795],{"class":696},[682,1053,756],{"class":692},[682,1055,1056],{"class":709},"https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fcalendar.readonly",[682,1058,756],{"class":692},[682,1060,1061],{"class":696},"]",[682,1063,759],{"class":692},[682,1065,1067,1070,1072,1074,1076,1078],{"class":684,"line":1066},22,[682,1068,1069],{"class":744},"      clientId",[682,1071,748],{"class":692},[682,1073,706],{"class":692},[682,1075,875],{"class":709},[682,1077,756],{"class":692},[682,1079,759],{"class":692},[682,1081,1083,1086,1088,1090,1092,1094],{"class":684,"line":1082},23,[682,1084,1085],{"class":744},"      clientSecret",[682,1087,748],{"class":692},[682,1089,706],{"class":692},[682,1091,920],{"class":709},[682,1093,756],{"class":692},[682,1095,759],{"class":692},[682,1097,1099],{"class":684,"line":1098},24,[682,1100,1101],{"class":765},"      \u002F\u002F Google gives a refresh token only for offline access, and only when the person agrees again.\n",[682,1103,1105,1108,1110,1112,1115,1117,1119,1122,1124,1126,1129,1131,1133,1136,1138],{"class":684,"line":1104},25,[682,1106,1107],{"class":744},"      authorizeParams",[682,1109,748],{"class":692},[682,1111,693],{"class":692},[682,1113,1114],{"class":744}," access_type",[682,1116,748],{"class":692},[682,1118,706],{"class":692},[682,1120,1121],{"class":709},"offline",[682,1123,756],{"class":692},[682,1125,805],{"class":692},[682,1127,1128],{"class":744}," prompt",[682,1130,748],{"class":692},[682,1132,706],{"class":692},[682,1134,1135],{"class":709},"consent",[682,1137,756],{"class":692},[682,1139,938],{"class":692},[682,1141,1143],{"class":684,"line":1142},26,[682,1144,1145],{"class":692},"    }\n",[682,1147,1149],{"class":684,"line":1148},27,[682,1150,1151],{"class":692},"  }\n",[682,1153,1155,1158],{"class":684,"line":1154},28,[682,1156,1157],{"class":692},"}",[682,1159,1160],{"class":696},")\n",[619,1162,1163],{},"SHADE refuses the module when it loads if:",[1165,1166,1167,1171,1177,1185],"ul",{},[1168,1169,1170],"li",{},"an endpoint is not https, or holds a user name, password or fragment;",[1168,1172,1173,1174,1176],{},"the token or revocation endpoint is on a host your ",[636,1175,670],{}," capability does not name (the authorization endpoint\nis only visited by the admin's browser, so it needs no host);",[1168,1178,1179,1181,1182,1184],{},[636,1180,875],{}," is not one of your settings, or ",[636,1183,920],{}," is not a secret setting;",[1168,1186,1187,1190,1191,639,1194,639,1197,639,1200,759,1203,639,1206,639,1209,1212],{},[636,1188,1189],{},"authorizeParams"," names a parameter SHADE sets itself (",[636,1192,1193],{},"response_type",[636,1195,1196],{},"client_id",[636,1198,1199],{},"redirect_uri",[636,1201,1202],{},"scope",[636,1204,1205],{},"state",[636,1207,1208],{},"code_challenge",[636,1210,1211],{},"code_challenge_method",").",[619,1214,1215],{},"Ask for the fewest scopes that do the job, read-only where the service has them.",[658,1217,1219],{"id":1218},"the-redirect-address","The redirect address",[619,1221,1222],{},"Every instance has one redirect address, made from its configuration, never from a request:",[673,1224,1228],{"className":1225,"code":1227,"language":861},[1226],"language-text","\u003CSHADE_ADMIN_URL, or SHADE_API_URL>\u002Fapi\u002Fpackages\u002Foauth\u002Fcallback\n",[636,1229,1227],{"__ignoreMap":678},[619,1231,1232],{},"Register exactly that address with the provider, for every module and provider on the instance. Tell the instance's\noperator in your module's README: the client id and secret come from the client's own account at the provider, so\ntheir data never passes through anyone else's app.",[658,1234,1236],{"id":1235},"connecting-an-account","Connecting an account",[619,1238,1239],{},"An admin (anyone who may manage modules) connects an account from your module's settings section or page: a button\nthat asks SHADE for the provider's address and sends the browser there.",[673,1241,1243],{"className":675,"code":1242,"language":677,"meta":678,"style":678},"const { url } = await $fetch('\u002Fapi\u002Fpackages\u002Foauth\u002Fcalendars-google\u002Fgoogle\u002Fstart', {\n  method: 'POST',\n  body: { account: 'default', returnTo: '\u002Fmodule-settings\u002Fcalendars-google' }\n})\nwindow.location.href = url\n",[636,1244,1245,1280,1296,1333,1339],{"__ignoreMap":678},[682,1246,1247,1251,1253,1256,1258,1261,1264,1267,1269,1271,1274,1276,1278],{"class":684,"line":685},[682,1248,1250],{"class":1249},"spNyl","const",[682,1252,693],{"class":692},[682,1254,1255],{"class":696}," url ",[682,1257,1157],{"class":692},[682,1259,1260],{"class":692}," =",[682,1262,1263],{"class":688}," await",[682,1265,1266],{"class":732}," $fetch",[682,1268,735],{"class":696},[682,1270,756],{"class":692},[682,1272,1273],{"class":709},"\u002Fapi\u002Fpackages\u002Foauth\u002Fcalendars-google\u002Fgoogle\u002Fstart",[682,1275,756],{"class":692},[682,1277,805],{"class":692},[682,1279,777],{"class":692},[682,1281,1282,1285,1287,1289,1292,1294],{"class":684,"line":716},[682,1283,1284],{"class":744},"  method",[682,1286,748],{"class":692},[682,1288,706],{"class":692},[682,1290,1291],{"class":709},"POST",[682,1293,756],{"class":692},[682,1295,759],{"class":692},[682,1297,1298,1301,1303,1305,1308,1310,1312,1315,1317,1319,1322,1324,1326,1329,1331],{"class":684,"line":723},[682,1299,1300],{"class":744},"  body",[682,1302,748],{"class":692},[682,1304,693],{"class":692},[682,1306,1307],{"class":744}," account",[682,1309,748],{"class":692},[682,1311,706],{"class":692},[682,1313,1314],{"class":709},"default",[682,1316,756],{"class":692},[682,1318,805],{"class":692},[682,1320,1321],{"class":744}," returnTo",[682,1323,748],{"class":692},[682,1325,706],{"class":692},[682,1327,1328],{"class":709},"\u002Fmodule-settings\u002Fcalendars-google",[682,1330,756],{"class":692},[682,1332,938],{"class":692},[682,1334,1335,1337],{"class":684,"line":741},[682,1336,1157],{"class":692},[682,1338,1160],{"class":696},[682,1340,1341,1344,1347,1350,1352,1355,1358],{"class":684,"line":762},[682,1342,1343],{"class":696},"window",[682,1345,1346],{"class":692},".",[682,1348,1349],{"class":696},"location",[682,1351,1346],{"class":692},[682,1353,1354],{"class":696},"href ",[682,1356,1357],{"class":692},"=",[682,1359,1360],{"class":696}," url\n",[619,1362,1363,1366,1367,1369,1370,1373,1374,1377],{},[636,1364,1365],{},"account"," names the account when your module keeps more than one (lower-case letters, digits and dashes;\n",[636,1368,1314],{}," when left out). ",[636,1371,1372],{},"returnTo"," is the admin path the browser comes back to, with ",[636,1375,1376],{},"?oauth=connected"," added; only\na path on the admin is taken.",[619,1379,1380,1381,1384,1385,1387,1388,1391],{},"SHADE uses the authorization code flow with PKCE (",[636,1382,1383],{},"S256","). The ",[636,1386,1205],{}," it sends is bound to the admin's session and\ntaken once, within ten minutes: a callback that comes back in another browser, too late, twice or with a state SHADE\nnever gave is refused with 403, without saying why. Why is in the audit log as ",[636,1389,1390],{},"protection.oauth-refused",", once per\nmodule a minute. The admin starts again from your module's page.",[619,1393,1394,1397,1398,1401],{},[636,1395,1396],{},"GET \u002Fapi\u002Fpackages\u002Foauth\u002F\u003Cplugin>"," lists the module's connected accounts for admins, and\n",[636,1399,1400],{},"DELETE \u002Fapi\u002Fpackages\u002Foauth\u002F\u003Cplugin>\u002F\u003Cprovider>\u002F\u003Caccount>"," disconnects one (revoked at the provider, audited).",[658,1403,1405],{"id":1404},"calling-the-providers-api","Calling the provider's API",[619,1407,1408,1410,1411,1414,1415,1418],{},[636,1409,642],{}," is ",[636,1412,1413],{},"moduleFetch"," with the account's access token as ",[636,1416,1417],{},"Authorization: Bearer",". SHADE refreshes the token\nfirst when it ends within a minute:",[673,1420,1422],{"className":675,"code":1421,"language":677,"meta":678,"style":678},"import { oauthFetch } from '@shadestack\u002Fmodule-sdk\u002Fserver'\n\nconst response = await oauthFetch(ctx, 'google', 'https:\u002F\u002Fwww.googleapis.com\u002Fcalendar\u002Fv3\u002Fusers\u002Fme\u002FcalendarList', { account: 'default' })\nconst calendars = await response.json()\n",[636,1423,1424,1443,1447,1499],{"__ignoreMap":678},[682,1425,1426,1428,1430,1433,1435,1437,1439,1441],{"class":684,"line":685},[682,1427,689],{"class":688},[682,1429,693],{"class":692},[682,1431,1432],{"class":696}," oauthFetch",[682,1434,700],{"class":692},[682,1436,703],{"class":688},[682,1438,706],{"class":692},[682,1440,710],{"class":709},[682,1442,713],{"class":692},[682,1444,1445],{"class":684,"line":716},[682,1446,720],{"emptyLinePlaceholder":719},[682,1448,1449,1451,1454,1456,1458,1460,1463,1465,1467,1470,1472,1474,1476,1479,1481,1483,1485,1487,1489,1491,1493,1495,1497],{"class":684,"line":723},[682,1450,1250],{"class":1249},[682,1452,1453],{"class":696}," response ",[682,1455,1357],{"class":692},[682,1457,1263],{"class":688},[682,1459,1432],{"class":732},[682,1461,1462],{"class":696},"(ctx",[682,1464,805],{"class":692},[682,1466,706],{"class":692},[682,1468,1469],{"class":709},"google",[682,1471,756],{"class":692},[682,1473,805],{"class":692},[682,1475,706],{"class":692},[682,1477,1478],{"class":709},"https:\u002F\u002Fwww.googleapis.com\u002Fcalendar\u002Fv3\u002Fusers\u002Fme\u002FcalendarList",[682,1480,756],{"class":692},[682,1482,805],{"class":692},[682,1484,693],{"class":692},[682,1486,1307],{"class":744},[682,1488,748],{"class":692},[682,1490,706],{"class":692},[682,1492,1314],{"class":709},[682,1494,756],{"class":692},[682,1496,700],{"class":692},[682,1498,1160],{"class":696},[682,1500,1501,1503,1506,1508,1510,1513,1515,1518],{"class":684,"line":741},[682,1502,1250],{"class":1249},[682,1504,1505],{"class":696}," calendars ",[682,1507,1357],{"class":692},[682,1509,1263],{"class":688},[682,1511,1512],{"class":696}," response",[682,1514,1346],{"class":692},[682,1516,1517],{"class":732},"json",[682,1519,1520],{"class":696},"()\n",[619,1522,1523,1524,1526,1527,1529,1530,1533,1534,1537,1538,1540],{},"The same rules as ",[636,1525,1413],{}," apply: only hosts your ",[636,1528,670],{}," capability names, over https, never into the\nserver's own network, and the token never follows a redirect to another origin. ",[636,1531,1532],{},"oauthAccessToken(ctx, provider, account?)"," gives the token itself, for a client library that wants one; use it at once and never store it.\n",[636,1535,1536],{},"oauthAccounts(ctx)"," lists your module's accounts (",[636,1539,655],{},": provider, account, status, scope, when the token\nends), never their tokens.",[619,1542,1543],{},"What can go wrong:",[1545,1546,1547,1563],"table",{},[1548,1549,1550],"thead",{},[1551,1552,1553,1557,1560],"tr",{},[1554,1555,1556],"th",{},"Error",[1554,1558,1559],{},"When",[1554,1561,1562],{},"What to do",[1564,1565,1566,1578,1596],"tbody",{},[1551,1567,1568,1572,1575],{},[1569,1570,1571],"td",{},"NOT_FOUND",[1569,1573,1574],{},"No such account is connected",[1569,1576,1577],{},"Ask an admin to connect it",[1551,1579,1580,1583,1593],{},[1569,1581,1582],{},"CONFLICT",[1569,1584,1585,1586,1589,1590],{},"The provider refused the refresh token (the person revoked access, or it expired): the account is ",[636,1587,1588],{},"broken",", audited once as ",[636,1591,1592],{},"packages.oauth.refresh-failed",[1569,1594,1595],{},"Show it on your page; an admin connects it again, which mends it",[1551,1597,1598,1601,1604],{},[1569,1599,1600],{},"UNAVAILABLE",[1569,1602,1603],{},"The provider did not answer a refresh (audited once a minute)",[1569,1605,1606],{},"Try again later; the account is kept",[658,1608,1610],{"id":1609},"what-shade-does-for-you","What SHADE does for you",[1165,1612,1613,1619,1636,1649,1655],{},[1168,1614,1615,1618],{},[626,1616,1617],{},"Sealed tokens."," The tokens are kept by SHADE, not in your tables, sealed with the instance's vault. They are\nnever in your module's settings, its backup on uninstall, an instance's export or any answer.",[1168,1620,1621,1627,1628,1631,1632,1635],{},[626,1622,1623,1624,1346],{},"Rotating ",[636,1625,1626],{},"APP_SECRET"," ",[636,1629,1630],{},"rotate-secrets"," seals them again with the new key. Your ",[636,1633,1634],{},"onSecretsRotated"," needs to do\nnothing for them.",[1168,1637,1638,1641,1642,1645,1646,1346],{},[626,1639,1640],{},"Uninstalling."," The accounts go with the uninstall, and once it has committed SHADE revokes each refresh token at\nthe provider's revocation endpoint. Your ",[636,1643,1644],{},"onUninstall"," needs to do nothing for them. A provider without a revocation\nendpoint, or one that does not answer, is noted in the audit log as ",[636,1647,1648],{},"packages.oauth.revoke-failed",[1168,1650,1651,1654],{},[626,1652,1653],{},"One refresh at a time."," Containers refresh an account one at a time, under a lease, and claim its refresh token\nin the database before they call the provider; nothing waits on a database transaction while the provider answers.\nA call that finds another container refreshing waits for the new token (up to about 12 seconds, else UNAVAILABLE).\nSo a provider that hands out a new refresh token on every refresh never sees the same one twice, even when a\ncontainer loses its lease mid-call.",[1168,1656,1657,1660,1661,652,1663,1665],{},[626,1658,1659],{},"Outside a transaction."," Call ",[636,1662,642],{},[636,1664,645],{}," outside your own transactions: a refresh within\none is refused, since the transaction would stay open while the provider answers.",[658,1667,1669],{"id":1668},"testing","Testing",[619,1671,1672,1673,1676,1677,1680,1681,1684,1685,1688,1689,1692],{},"Core's fixture ",[636,1674,1675],{},"oauth-probe"," (in SHADE's repository, ",[636,1678,1679],{},"shade\u002Ftest\u002Ftesting\u002Ffixtures\u002Fmodules\u002Foauth-probe",") connects\naccounts against a mock authorization server in the API's tests (",[636,1682,1683],{},"apps\u002Fapi\u002Ftest\u002Ftesting\u002Foauth-server.ts","): it answers\nbehind the modules' network stand-ins (",[636,1686,1687],{},"stubModuleNetwork({ resolve, send })"," from ",[636,1690,1691],{},"@shadestack\u002Fcore\u002Fservices",") and\nholds the flow to the rules a real provider does.",[1694,1695,1696],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":678,"searchDepth":716,"depth":716,"links":1698},[1699,1700,1701,1702,1703,1704],{"id":660,"depth":716,"text":661},{"id":1218,"depth":716,"text":1219},{"id":1235,"depth":716,"text":1236},{"id":1404,"depth":716,"text":1405},{"id":1609,"depth":716,"text":1610},{"id":1668,"depth":716,"text":1669},"md",null,{},{"title":447,"description":678},"yww-c7O78HLwAdDMKYU0qcg4qVIlrQ4NqgWlGgjfeHc",[1711,1712],{"title":443,"path":444,"stem":445,"description":678,"children":-1},{"title":451,"path":452,"stem":453,"description":678,"children":-1},1796500156175]