AuthProvider.java 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.gateway.provider;
  18. import org.springblade.core.launch.constant.TokenConstant;
  19. import java.util.ArrayList;
  20. import java.util.List;
  21. /**
  22. * 鉴权配置
  23. *
  24. * @author Chill
  25. */
  26. public class AuthProvider {
  27. public static final String AUTH_KEY = TokenConstant.HEADER;
  28. private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>();
  29. static {
  30. DEFAULT_SKIP_URL.add("/bm/**"); //白马三方接口放行
  31. DEFAULT_SKIP_URL.add("/example");
  32. DEFAULT_SKIP_URL.add("/oauth/token/**");
  33. DEFAULT_SKIP_URL.add("/loginByToken");
  34. DEFAULT_SKIP_URL.add("/loginByToken2");
  35. DEFAULT_SKIP_URL.add("/submit2");
  36. DEFAULT_SKIP_URL.add("/exceltab/callbackSave");
  37. DEFAULT_SKIP_URL.add("/oauth/captcha/**");
  38. DEFAULT_SKIP_URL.add("/oauth/clear-cache/**");
  39. DEFAULT_SKIP_URL.add("/oauth/user-info");
  40. DEFAULT_SKIP_URL.add("/oauth/render/**");
  41. DEFAULT_SKIP_URL.add("/oauth/callback/**");
  42. DEFAULT_SKIP_URL.add("/oauth/revoke/**");
  43. DEFAULT_SKIP_URL.add("/oauth/refresh/**");
  44. DEFAULT_SKIP_URL.add("/token/**");
  45. DEFAULT_SKIP_URL.add("/actuator/**");
  46. DEFAULT_SKIP_URL.add("/v2/api-docs/**");
  47. DEFAULT_SKIP_URL.add("/auth/**");
  48. DEFAULT_SKIP_URL.add("/log/**");
  49. DEFAULT_SKIP_URL.add("/menu/routes");
  50. DEFAULT_SKIP_URL.add("/menu/auth-routes");
  51. DEFAULT_SKIP_URL.add("/menu/top-menu");
  52. DEFAULT_SKIP_URL.add("/tenant/info");
  53. DEFAULT_SKIP_URL.add("/process/resource-view");
  54. DEFAULT_SKIP_URL.add("/process/diagram-view");
  55. DEFAULT_SKIP_URL.add("/manager/check-upload");
  56. DEFAULT_SKIP_URL.add("/error/**");
  57. DEFAULT_SKIP_URL.add("/assets/**");
  58. DEFAULT_SKIP_URL.add("/appVersion/page");
  59. DEFAULT_SKIP_URL.add("/appVersionDetail/**");
  60. }
  61. /**
  62. * 默认无需鉴权的API
  63. */
  64. public static List<String> getDefaultSkipUrl() {
  65. return DEFAULT_SKIP_URL;
  66. }
  67. }