Skip to content

Renaming ApiSecurityService method "checkAPIKey" to more purpose like names #2

@ytendx

Description

@ytendx

The method names in https://github.com/AunaCraft/ChatLog/blob/master/src/main/java/net/aunacraft/chatlogger/service/APISecurityService.java are not describing what they are doing.

In my opinion a "...check..." method should everytime return a value and not nothing.

public void checkAPIKey(String apiKey) {
        APIKey key = repository.findById(apiKey).orElseThrow(InvalidAPIKeyException::new);
        key.use();
        repository.save(key);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions