package extensionflow

// validKebabExtensionName reports whether value is lowercase kebab-case. Service
// Installation Extension names are exact Workspace-visible routing identities;
// they are never silently trimmed, lowercased, or normalized.
func validKebabExtensionName(value string) bool {
	if value == "" {
		return false
	}
	for i := 0; i < len(value); i++ {
		ch := value[i]
		switch {
		case ch >= 'a' && ch <= 'z':
		case ch >= '0' && ch <= '9':
		case ch == '-':
			if i == 0 || i == len(value)-1 || value[i-1] == '-' {
				return false
			}
		default:
			return false
		}
	}
	return true
}
