package Ġtop . vu he . database . config Ċ Ċ import Ġorg . apache . shiro . m gt . Security Manager Ċ import Ġorg . apache . shiro . session . m gt . Session Manager Ċ import Ġorg . apache . shiro . spring . Lifecycle Bean Post Processor Ċ import Ġorg . apache . shiro . spring . security . interceptor . Authorization Attribute Source Ad visor Ċ import Ġorg . apache . shiro . spring . web . Sh iro Filter Factory Bean Ċ import Ġorg . apache . shiro . web . m gt . Default Web Security Manager Ċ import Ġorg . apache . shiro . web . session . m gt . Default Web Session Manager Ċ import Ġorg . springframework . aop . framework . auto proxy . Default Ad visor Auto Proxy Creator Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġtop . vu he . database . auth . OAuth 2 Filter Ċ import Ġtop . vu he . database . auth . OAuth 2 Realm Ċ import Ġjavax . servlet . Filter Ċ Ċ /** Ċ Ġ* ĠSh iro Ġéħįç½® ç±» Ċ Ġ* Ċ Ġ* Ġ@ author : Ġv u he Ċ Ġ*/ Ċ @ Configuration Ċ class ĠSh iro Config Ġ{ ĊĠĠĠ Ġ@ Bean (" session Manager ") ĊĠĠĠ Ġfun Ġsession Manager (): ĠSession Manager ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsession Manager Ġ= ĠDefault Web Session Manager () ĊĠĠĠĠĠĠĠ Ġ// Ġæĺ¯åĲ¦ å®ļæĹ¶ æ£ĢæŁ¥ session ĊĠĠĠĠĠĠĠ Ġsession Manager . is Session Validation Scheduler Enabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġreturn Ġsession Manager ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean (" security Manager ") ĊĠĠĠ Ġfun Ġsecurity Manager ( ĊĠĠĠĠĠĠĠ Ġo Auth 2 Realm : ĠOAuth 2 Realm ?, Ġsession Manager : ĠSession Manager ? ĊĠĠĠ Ġ): ĠSecurity Manager ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsecurity Manager Ġ= ĠDefault Web Security Manager () ĊĠĠĠĠĠĠĠ Ġsecurity Manager . set Realm ( o Auth 2 Realm ) ĊĠĠĠĠĠĠĠ Ġsecurity Manager . session Manager Ġ= Ġsession Manager ĊĠĠĠĠĠĠĠ Ġreturn Ġsecurity Manager ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean (" shiro Filter ") ĊĠĠĠ Ġfun Ġsh ir Filter ( security Manager : ĠSecurity Manager ?): ĠSh iro Filter Factory Bean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsh iro Filter Ġ= ĠSh iro Filter Factory Bean () ĊĠĠĠĠĠĠĠ Ġsh iro Filter . security Manager Ġ= Ġsecurity Manager ĊĊĠĠĠĠĠĠĠ Ġ// oauth è¿ĩæ»¤ ĊĠĠĠĠĠĠĠ Ġval Ġfilters : ĠMutable Map < String , ĠFilter > Ġ= ĠHashMap () ĊĠĠĠĠĠĠĠ Ġfilters [" oauth 2 "] Ġ= ĠOAuth 2 Filter ĊĠĠĠĠĠĠĠ Ġsh iro Filter . filters Ġ= Ġfilters ĊĠĠĠĠĠĠĠ Ġval Ġfilter Map : ĠMutable Map < String , ĠString > Ġ= ĠLinkedHashMap () ĊĠĠĠĠĠĠĠ Ġ// Ġ ä¸¤ä¸ª url è§ĦåĪĻ éĥ½ åı¯ä»¥ åĮ¹éħį åĲĮ ä¸Ģä¸ª url ï¼Į åıª æī§è¡Į ç¬¬ä¸Ģä¸ª ĊĠĠĠĠĠĠĠ Ġfilter Map [" / api / login "] Ġ= Ġ" anon " ĊĠĠĠĠĠĠĠ Ġfilter Map [" / api /** "] Ġ= Ġ" oauth 2 " ĊĠĠĠĠĠĠĠ Ġ// Ġ åħ¶ ä½Ļ éĥ½ ä¸į è¿Ľè¡Į éªĮè¯ģ ĊĠĠĠĠĠĠĠ Ġfilter Map [" /** "] Ġ= Ġ" anon " ĊĠĠĠĠĠĠĠ Ġsh iro Filter . filter Chain Definition Map Ġ= Ġfilter Map ĊĠĠĠĠĠĠĠ Ġreturn Ġsh iro Filter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean (" lifecycle Bean Post Processor ") ĊĠĠĠ Ġfun Ġlifecycle Bean Post Processor (): ĠLifecycle Bean Post Processor ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠLifecycle Bean Post Processor () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġdefault Ad visor Auto Proxy Creator (): ĠDefault Ad visor Auto Proxy Creator ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproxy Creator Ġ= ĠDefault Ad visor Auto Proxy Creator () ĊĠĠĠĠĠĠĠ Ġproxy Creator . is Proxy Target Class Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġreturn Ġproxy Creator ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġauthorization Attribute Source Ad visor ( ĊĠĠĠĠĠĠĠ Ġsecurity Manager : ĠSecurity Manager ? ĊĠĠĠ Ġ): ĠAuthorization Attribute Source Ad visor ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġad visor Ġ= ĠAuthorization Attribute Source Ad visor () ĊĠĠĠĠĠĠĠ Ġad visor . security Manager Ġ= Ġsecurity Manager ĊĠĠĠĠĠĠĠ Ġreturn Ġad visor ĊĠĠĠ Ġ} Ċ }