if ( updateRequest.getAddConfigs().get(TokenConfigEnum.CLAIMS.getValue().toLowerCase()) != null && IAPConstants.SQUAREBRACKETS.equals(updateRequest.getRemoveConfigs().toString()) || Objects.nonNull(updateRequest.getRemoveConfigs()) && !updateRequest.getRemoveConfigs().isEmpty() && !updateRequest.getRemoveConfigs().contains(TokenConfigEnum.CLAIMS.getValue().toLowerCase()) ) { identityTokenVO.getTokenConfigs() .stream() .forEach(config -> { if (TokenConfigEnum.CLAIMS.getValue().toLowerCase().equals(config.getKey().toLowerCase()) && config.getValue() != null ) { updateRequest.getAddConfigs().get(TokenConfigEnum.CLAIMS.getValue().toLowerCase()).addAll(config.getValue()); } }); } if ( updateRequest.getAddConfigs().get(TokenConfigEnum.CLAIMS.getValue().toUpperCase()) != null && IAPConstants.SQUAREBRACKETS.equals(updateRequest.getRemoveConfigs().toString()) || Objects.nonNull(updateRequest.getRemoveConfigs()) && !updateRequest.getRemoveConfigs().isEmpty() && !updateRequest.getRemoveConfigs().contains(TokenConfigEnum.CLAIMS.getValue().toLowerCase())){ identityTokenVO.getTokenConfigs() .stream() .forEach(config -> { if (TokenConfigEnum.CLAIMS.getValue().toUpperCase().equals(config.getKey().toUpperCase()) && config.getValue() != null ) { updateRequest.getAddConfigs().get(TokenConfigEnum.CLAIMS.getValue().toUpperCase()).addAll(config.getValue()); } }); } if ( updateRequest.getAddConfigs().get(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toLowerCase()) != null && IAPConstants.SQUAREBRACKETS.equals(updateRequest.getRemoveConfigs().toString()) || Objects.nonNull(updateRequest.getRemoveConfigs()) && !updateRequest.getRemoveConfigs().isEmpty() && !updateRequest.getRemoveConfigs().contains(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toLowerCase())) { identityTokenVO.getTokenConfigs() .stream() .forEach(config -> { if (TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toLowerCase().equals(config.getKey().toLowerCase()) && config.getValue() != null ) { updateRequest.getAddConfigs().get(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toLowerCase()).addAll(config.getValue()); } }); } if ( updateRequest.getAddConfigs().get(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toUpperCase()) != null && IAPConstants.SQUAREBRACKETS.equals(updateRequest.getRemoveConfigs().toString()) || Objects.nonNull(updateRequest.getRemoveConfigs()) && !updateRequest.getRemoveConfigs().isEmpty() && !updateRequest.getRemoveConfigs().contains(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toUpperCase())) { identityTokenVO.getTokenConfigs() .stream() .forEach(config -> { if (TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toUpperCase().equals(config.getKey().toUpperCase()) && config.getValue() != null ) { updateRequest.getAddConfigs().get(TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue().toUpperCase()).addAll(config.getValue()); } }); }
private String toUpOrLowerCase( String str, String caseFlag ){ if (IAPConstants.UPPERCASE.equals(caseFlag)) { return str.toUpperCase(); } else if (IAPConstants.LOWERCASE.equals(caseFlag)) { return str.toLowerCase(); } else { return str; } } private void setTokenUpdateRequest(IdentityTokenVO identityTokenVO,TokenUpdateRequest updateRequest,String key , String caseFlag){ identityTokenVO.getTokenConfigs() .stream() .forEach(config -> { if (key.equals(toUpOrLowerCase(config.getKey(),caseFlag)) && config.getValue() != null ) { updateRequest.getAddConfigs().get(key).addAll(config.getValue()); } }); } private boolean checkRemoveKey(TokenUpdateRequest updateRequest,String key,String caseFlag ){ if (updateRequest.getRemoveConfigs() != null && IAPConstants.SQUAREBRACKETS.equals(updateRequest.getRemoveConfigs().toString()) || Objects.nonNull(updateRequest.getRemoveConfigs()) && !updateRequest.getRemoveConfigs().isEmpty() && !updateRequest.getRemoveConfigs().contains(toUpOrLowerCase(key,caseFlag))){ return true; } else { return false; } } private void setTokenClaimAndDeviceAuthenticationKey(IdentityTokenVO identityTokenVO,TokenUpdateRequest updateRequest){ String claims = TokenConfigEnum.CLAIMS.getValue(); String deviceAuthKey = TokenConfigEnum.DEVICE_AUTHENTICATION_KEYS.getValue(); if ( updateRequest.getAddConfigs().get(claims.toLowerCase()) != null && checkRemoveKey(updateRequest,claims,IAPConstants.LOWERCASE) ) { setTokenUpdateRequest(identityTokenVO,updateRequest,claims.toLowerCase(),IAPConstants.LOWERCASE); } if ( updateRequest.getAddConfigs().get(claims.toUpperCase()) != null && checkRemoveKey(updateRequest,claims,IAPConstants.UPPERCASE) ){ setTokenUpdateRequest(identityTokenVO,updateRequest,claims.toUpperCase(),IAPConstants.UPPERCASE); } if ( updateRequest.getAddConfigs().get(deviceAuthKey.toLowerCase()) != null && checkRemoveKey(updateRequest,deviceAuthKey,IAPConstants.LOWERCASE) ) { setTokenUpdateRequest(identityTokenVO,updateRequest,deviceAuthKey.toLowerCase(),IAPConstants.LOWERCASE); } if ( updateRequest.getAddConfigs().get(deviceAuthKey.toUpperCase()) != null && checkRemoveKey(updateRequest,deviceAuthKey,IAPConstants.UPPERCASE) ){ setTokenUpdateRequest(identityTokenVO,updateRequest,deviceAuthKey.toUpperCase(),IAPConstants.UPPERCASE); } }
相关推荐
On most computer systems, a small piece of code known as the bootstrap program or bootstrap loader locates the kernel, loads it into main memory, and starts its execution. Some computer systems, such...
Making Software - What Really Works, and Why We Believe It. Does the MMR vaccine cause autism... Is it possible to predict the likely number of bugs in a piece of code before it’s released? If so, how?
This means that a traditional HTML5 project which, under native javascript would involve thousands of lines of code, is a piece of cake under Smart. As a language object pascal is easy on the eyes, ...
Examples of outcomes are a piece of software, a decision made or a report written. 2.5. FreeBSD When saying “FreeBSD” we will mean the BSD derivative UNIX-like operating system FreeBSD, whereas ...
A Part-Of-Speech Tagger (POS Tagger) is a piece of software that reads text in some language and assigns parts of speech to each word (and other token), such as noun, verb, adjective, etc., although ...
Chapter 11, Angular Material, takes you through Angular Material, which not only offers a beautiful interface but also comes with a bunch of components that will make it a piece of cake to quickly ...
You don’t need to choose a particular programming language, or library, or piece of hardware, because our approach is largely independent of those things. Our focus is on the principles and ...
You don’t need to choose a particular programming language, or library, or piece of hardware, because our approach is largely independent of those things. Our focus is on the principles and ...
This is a book of recipes: solutions to common problems, copy-and-paste code snip‐ pets, explanations, examples, and short tutorials. This book is meant to save you time. Time, as they say, is money,...
dauntless.zip This is an exceptionally good piece of code. One program runs on a machine somewhere, and the other on your machine. You can then send commands to the other machine, take screen ...
The goal of this guide is to manage this complexity by describing in detail the dos and don'ts of writing C++ code. These rules exist to keep the code base manageable while still allowing coders to ...
If you write a piece of software that allows people to buy clothes online, you will have to represent real people, real clothes, real brands, sizes, and so on and so forth, within the boundaries of ...
The third and the last module of our course will take an example-based approach where each concept covered is supported by example code to not only give you a good understanding of the concept, but ...
Two mode of operation Flush immediate and Deferred ( the latter being faster at the expense of the risk of non-clean shutdown data loss). Enumerate the index is supported. Enumerate the Storage file ...
T ABLE OF C ONTENTS Who is this book for? ........................................................................................................................ i About This Book ......................
c) Place a copy of vsdrvr.dll in either the folder that includes the executable code for the program being developed; or, preferably, in the windows system folder. Failures in step a) will lead to ...
Acknowledgments xiii Introduction xv 1. Making Games the Modular Way 1 1.1 Important Programming Concepts.....................................2 1.1.1 Manager and Controller Scripts.......................
The goal is to get you familiar with ASP.NET Core 1.1 by adding middleware and services one piece at a time, building a basic application. Then you will build a second MVC application using a ...