Skip to content

Commit 496af84

Browse files
committed
all: add license headers and author tags
Signed-off-by: Daniel Garnier-Moiroux <[email protected]>
1 parent b73d053 commit 496af84

File tree

27 files changed

+325
-0
lines changed

27 files changed

+325
-0
lines changed

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/ApiKey.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey;
218

319
import org.jspecify.annotations.Nullable;
420

21+
/**
22+
* @author Daniel Garnier-Moiroux
23+
*/
524
public interface ApiKey {
625

726
String getId();

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/ApiKeyEntity.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey;
218

319
import java.util.Collections;
@@ -6,6 +22,9 @@
622
import org.springframework.security.core.CredentialsContainer;
723
import org.springframework.security.core.GrantedAuthority;
824

25+
/**
26+
* @author Daniel Garnier-Moiroux
27+
*/
928
public interface ApiKeyEntity extends ApiKey, CredentialsContainer {
1029

1130
default List<GrantedAuthority> getAuthorities() {

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/ApiKeyEntityRepository.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey;
218

319
import org.jspecify.annotations.Nullable;
420

21+
/**
22+
* @author Daniel Garnier-Moiroux
23+
*/
524
public interface ApiKeyEntityRepository<T extends ApiKeyEntity> {
625

726
@Nullable

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/ApiKeyImpl.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey;
218

319
import org.springframework.util.StringUtils;
420

21+
/**
22+
* @author Daniel Garnier-Moiroux
23+
*/
524
public class ApiKeyImpl implements ApiKey {
625

726
private final String id;

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/authentication/ApiKeyAuthenticationProvider.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey.authentication;
218

319
import org.jspecify.annotations.Nullable;
@@ -12,6 +28,9 @@
1228
import org.springframework.security.crypto.password.PasswordEncoder;
1329
import org.springframework.util.Assert;
1430

31+
/**
32+
* @author Daniel Garnier-Moiroux
33+
*/
1534
public class ApiKeyAuthenticationProvider<T extends ApiKeyEntity> implements AuthenticationProvider {
1635

1736
private final ApiKeyEntityRepository<T> apiKeyEntityRepository;

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/authentication/ApiKeyAuthenticationToken.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey.authentication;
218

319
import java.util.Collection;
@@ -10,6 +26,9 @@
1026
import org.springframework.security.core.GrantedAuthority;
1127
import org.springframework.security.core.Transient;
1228

29+
/**
30+
* @author Daniel Garnier-Moiroux
31+
*/
1332
@Transient
1433
public class ApiKeyAuthenticationToken extends AbstractAuthenticationToken {
1534

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/authentication/package-info.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
@NullMarked
218
package org.springaicommunity.mcp.security.server.apikey.authentication;
319

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/memory/ApiKeyEntityImpl.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey.memory;
218

319
import org.jspecify.annotations.Nullable;
@@ -7,6 +23,9 @@
723
import org.springframework.security.crypto.password.PasswordEncoder;
824
import org.springframework.util.Assert;
925

26+
/**
27+
* @author Daniel Garnier-Moiroux
28+
*/
1029
public class ApiKeyEntityImpl implements ApiKeyEntity {
1130

1231
private final String id;

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/memory/InMemoryApiKeyEntityRepository.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springaicommunity.mcp.security.server.apikey.memory;
218

319
import java.util.Collection;
@@ -8,6 +24,9 @@
824
import org.springaicommunity.mcp.security.server.apikey.ApiKeyEntity;
925
import org.springaicommunity.mcp.security.server.apikey.ApiKeyEntityRepository;
1026

27+
/**
28+
* @author Daniel Garnier-Moiroux
29+
*/
1130
public class InMemoryApiKeyEntityRepository<T extends ApiKeyEntity> implements ApiKeyEntityRepository<T> {
1231

1332
private final Map<String, T> apiKeys = new ConcurrentHashMap<>();

mcp-server-security/src/main/java/org/springaicommunity/mcp/security/server/apikey/memory/package-info.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
@NullMarked
218
package org.springaicommunity.mcp.security.server.apikey.memory;
319

0 commit comments

Comments
 (0)