diff --git a/src/main/java/org/edgegallery/developer/filter/security/AccessTokenFilter.java b/src/main/java/org/edgegallery/developer/filter/security/AccessTokenFilter.java index bdeaa4befe3b55d490e3834c4d3b65ca1cad576d..23541a968c35b916d9c3beaa92236f94bb16a1cf 100644 --- a/src/main/java/org/edgegallery/developer/filter/security/AccessTokenFilter.java +++ b/src/main/java/org/edgegallery/developer/filter/security/AccessTokenFilter.java @@ -37,10 +37,12 @@ import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; - +/* @Component @Import({ResourceServerTokenServicesConfiguration.class}) @EnableGlobalMethodSecurity(prePostEnabled = true) + + */ public class AccessTokenFilter extends OncePerRequestFilter { private static final Logger LOGGER = LoggerFactory.getLogger(AccessTokenFilter.class); diff --git a/src/test/resources/testdata/container_package/namespacetest.mf b/src/test/resources/testdata/container_package/namespacetest.mf index 0dff242a4e610cb185ac22aa2db346f011d01e08..5af201c017206c4c100a4f12068a5c8fcb98b6c3 100644 --- a/src/test/resources/testdata/container_package/namespacetest.mf +++ b/src/test/resources/testdata/container_package/namespacetest.mf @@ -19,5 +19,5 @@ Source: APPD/MainServiceTemplate.zip Algorithm: SHA-256 Hash:eb00f69ded4e54f6bc27aaff056bb38a273341e674da74a455d12d39403b4ddc -----BEGIN CMS----- -MIAGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZQMEAgEwgAYJKoZIhvcNAQcBoIAkgASCAYZTb3VyY2U6IEFydGlmYWN0cy9EZXBsb3ltZW50L0NoYXJ0cy9uYW1lc3BhY2V0ZXN0LnRnegpBbGdvcml0aG06IFNIQS0yNTYKSGFzaDpjOGEzZmE0ZWUyNzllMjFiZDUzZjA5ODdhZTdmNWRiNjc5Y2I1MmFiN2JiNzJhZDE0YzFiZDQwYzVhODI5YWQ2CgpTb3VyY2U6IEltYWdlL1N3SW1hZ2VEZXNjLmpzb24KQWxnb3JpdGhtO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NDEeMBwwCwYJYIZIAWUDBAIBoQ0GCSqGSIb3DQEBCwUAMC8GCSqGSIb3DQEJBDEiBCB+HdDadgjmx/ixjA0++2F4Q7zCM/GJbRwlS2mOS8uwRDANBgkqhkiG9w0BAQsFAASBgDiQ0cmnkG3u3AFTMJ7qktT1iBbPaIJJBUBM6D9GnZYrIHgFQBZOtpwhJbI1uEDZ6cz1T2mcLpWOFIhAElrRJFNGqZipoOfmjLPJ1L55kTgqIBAaFz31Q1pZy5v4wPYwh0J0PZnSpJmoWCVYLJU0pt8Dr4PRQZ+GVNemoh2xMZWZAAAAAAAA -----END CMS----- \ No newline at end of file diff --git a/src/test/resources/testdata/vm_package/vmtest.mf b/src/test/resources/testdata/vm_package/vmtest.mf index ef677bf8d37b9502478dbd58e6722f42b106b62f..ccfb30f5739f8ce4efc5ac5703e98baf95153841 100644 --- a/src/test/resources/testdata/vm_package/vmtest.mf +++ b/src/test/resources/testdata/vm_package/vmtest.mf @@ -13,8 +13,8 @@ Hash:71d79b9ff07a0786e2f1c406efaefa43d51dd6bab7bca7ba5b686e0ea3c2ce59 Source: Image/SwImageDesc.json Algorithm: SHA-256 -Hash:08362570576f4951527cbd88f922d55ab3c92bb8bee733bf64051b8e47a4e0f3 +Hash:fc8033368aa5f6ac03362371f61a3712a838a7dd1fb8ac3590b81c980a1f49d3 ------BEGIN CMS----- -MIAGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZQMEAgEwgAYJKoZIhvcNAQcBoIAkgASB6VNvdXJjZTogQVBQRC92bXRlc3QuemlwCkFsZ29yaXRobTogU0hBLTI1NgpIYXNoOjcxZDc5YjlmZjA3YTA3ODZlMmYxYzQwNmVmYWVmYTQzZDUxZGQ2YmFiN2JjYTdiYTViNjg2ZTBlYTNjMmNlNTkKClNvdXJjZTogSW1hZ2UvU3dJbWFnZURlc2MuanNvbgpBbGdvcml0aG06IFNIQS0yNTYKSGFzaDowODM2MjU3MDU3NmY0OTUxNTI3Y2JkODhmOTIyZDU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