The invention relates to a statistical identity authentication and log processing micro-service system and its implementation method, and relates to the technical field of network security. The invention realizes user login authentication based on zuul gateway of spring cloud and static authentication of jwt, intercepts system log based on Web filter annotation of spring boot, designs an application system and its implementation method for HTTP restful request mode and detailed log record. The invention makes use of spring cloud micro-service to be very compatible. It is easy to realize the Componentization of the system, which not only improves the performance of the system, but also facilitates maintenance. Both authentication and log recording services are applied to the authentication and analysis of jwt. Moreover, the zuul gateway is an interception process for all paths. Therefore, it is not necessary to subdivide the two modules into two micro-service components separately, so the high cohesion of the code is really realized. Low coupling requirements.
【技术实现步骤摘要】
统计身份认证及日志处理微服务系统及其实现方法
本专利技术涉及网络安全
,具体涉及一种统计身份认证及日志处理微服务系统及其实现方法。
技术介绍
随着互联网应用的普及,在大数据、高并发的环境下,系统架构需要面对极为严苛的挑战,必须至少要满足高性能、独立性、容易扩展、便于管理、状态监控与告警这几个方面,由此微服务架构便应运而生。传统的单体应用将所有业务功能全部聚合在一个项目中,如图1所示。这样的单体应用隐患非常的多,任何一个bug都有可能导致整个系统宕机,维护这样的一个系统,不仅效率极低,而且充满风险。
技术实现思路
(一)要解决的技术问题本专利技术要解决的技术问题是:如何设计一种能够满足代码的高内聚低耦合要求的统计身份认证及日志处理微服务系统及其实现方法。(二)技术方案为了解决上述技术问题,本专利技术提供了一种统计身份认证及日志处理微服务系统,包括身份认证模块;所述身份认证模块用于自定义过滤器并继承Zuul过滤器,并利用四种方法重写Zuul过滤器,所述四种方法分别是设置过滤方式、过滤顺序,过滤的路径以及进行身份认证的具体操作。优选地,所述系统还包括日志管理模块,所述日志管理模块用于在身份认证模块重写Zuul过滤器之后,实现过滤器,对相应操作进行拦截,并将拦截的日志记录到数据库中。本专利技术还提供了一种所述的系统的实现方法,包括以下步骤:所述身份认证模块的具体实现步骤如下:步骤1、自定义过滤器并继承Zuul过滤器;步骤2、利用四种方法重写Zuul过滤器:设置过滤方式、过滤顺序,过滤的路径以及进行身份认证的具体操作,进行身份认证的具体操作时,封装不符合身份认证的 ...
【技术保护点】
1.一种统计身份认证及日志处理微服务系统,其特征在于,包括身份认证模块;所述身份认证模块用于自定义过滤器并继承Zuul过滤器,并利用四种方法重写Zuul过滤器,所述四种方法分别是设置过滤方式、过滤顺序,过滤的路径以及进行身份认证的具体操作。
【技术特征摘要】
1.一种统计身份认证及日志处理微服务系统,其特征在于,包括身份认证模块;所述身份认证模块用于自定义过滤器并继承Zuul过滤器,并利用四种方法重写Zuul过滤器,所述四种方法分别是设置过滤方式、过滤顺序,过滤的路径以及进行身份认证的具体操作。2.如权利要求1所述的系统,其特征在于,所述系统还包括日志管理模块,所述日志管理模块用于在身份认证模块重写Zuul过滤器之后,实现过滤器,对相应操作进行拦截,并将拦截的日志记录到数据库中。3.一种如权利要求2所述的系统的实现方法,其特征在于,包括以下步骤:所述身份认证模块的具体实现步骤如下:步骤1、自定义过滤器并继承Zuul过滤器;步骤2、利用四种方法重写Zuul过滤器:设置过滤方式、过滤顺序,过滤的路径以及进行身份认证的具体操作,进行身份认证的具体操作时,封装不符合身份认证的请求的信息,并返回。4.如权利要求3所述的方法,其特征在于,步骤2中,配置过滤优先级为0,为最高优先级,过滤方式为“pre”,在http的pre阶段进行过滤。5.如权利要求3所述的方法,其特征在于,步骤2中,还配置过滤的路径,当请求路径为本地路径或者为获取令牌接口时不进行过滤,对于其他所有路径都进行过滤。6.如权利要求5所述的方法,其特征在于,步骤2中,还进行身份认证的具体操作:获取当前请求的请求头中的令牌,通过jwt根据后端配...
【专利技术属性】
技术研发人员:陈梦飞,
申请(专利权)人:北京计算机技术及应用研究所,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。