master
DEV 2 years ago
parent d226bbe0f4
commit 1be5254b24

@ -35,7 +35,8 @@ var (
ErrInvalidIDRole errs.ErrCode ErrInvalidIDRole errs.ErrCode
ErrRoleCycle errs.ErrCode ErrRoleCycle errs.ErrCode
RoleProvider RoleProvider RoleManager RoleManager
UserManager UserManager
} { } {

@ -0,0 +1,47 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
import "time"
type (
Actor struct {
ID ActorID
State ActorState
Flags ActorFlags
CreatedBy ActorID
CreatedAt time.Time
ModifiedBy ActorID
ModifiedAt time.Time
Name string
Description string
}
)

@ -2,7 +2,7 @@
// 🚀 Project Active8 // 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go // 🔗 Active Thing (activething.com) git.activething.com/go
// //
// File name actor_flags.go // File name actor_state_flags.go
// ✍️ Created by DEV // ✍️ Created by DEV
// 📅 Modified 07/12/2024 // 📅 Modified 07/12/2024
// //
@ -31,6 +31,7 @@ const (
ActorFlagRequired ActorFlags = 0b00000010 ActorFlagRequired ActorFlags = 0b00000010
ActorFlagRestricted ActorFlags = 0b00000011 ActorFlagRestricted ActorFlags = 0b00000011
ActorFlagLimited ActorFlags = 0b00000100 ActorFlagLimited ActorFlags = 0b00000100
ActorFlagUnique ActorFlags = 0b00000101 // Solo puede existir un actor simultaneamente
) )
@ -61,6 +62,11 @@ func (a ActorFlags) HasLimited() bool {
return a&ActorFlagLimited != 0 return a&ActorFlagLimited != 0
} }
func (a ActorFlags) HasUnique () bool {
return a&ActorFlagUnique != 0
}
func (a ActorFlags) Count() int { func (a ActorFlags) Count() int {
if a == 0 { if a == 0 {
return 0 return 0

@ -2,7 +2,7 @@
// 🚀 Project Active8 // 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go // 🔗 Active Thing (activething.com) git.activething.com/go
// //
// File name actor_state.go // File name actor_mode.go
// ✍️ Created by DEV // ✍️ Created by DEV
// 📅 Modified 07/12/2024 // 📅 Modified 07/12/2024
// //

@ -0,0 +1,55 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_role_manager.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
import "brbac"
type (
DRoleManager struct {
provider brbac.RoleProvider
repository brbac.RoleRepository
}
DRoleManagerFnc func (rm *DRoleManager) error
)
func NewDRoleManager (provider brbac.RoleProvider, repository brbac.RoleRepository, ops ... DRoleManagerFnc) (*DRoleManager, error) {
rm := &DRoleManager {
provider : provider,
repository : repository,
}
for _,o := range ops {
if e:=o(rm); e!=nil {
return nil,e
}
}
return rm,nil
}

@ -0,0 +1,53 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_role_provider.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
import "brbac"
type (
DRoleProvider struct {
repository brbac.RoleRepository
}
DRoleProviderFnc func(rp *DRoleProvider) error
)
func NewDRoleProvider (repository brbac.RoleRepository, ops ...DRoleProviderFnc) (*DRoleProvider,error) {
rp := &DRoleProvider{
repository: repository,
}
for _,o := range ops {
if e := o(rp); e != nil {
return nil,e
}
}
return rp,nil
}

@ -0,0 +1,50 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_role_repository.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
type (
DRoleRepository struct {
}
DRoleRepositoryFnc func (rr *DRoleRepository) error
)
func NewDRoleRepository (ops ...DRoleRepositoryFnc) (*DRoleRepository,error) {
rr := &DRoleRepository{}
for _,o := range ops {
if e:=o(rr); e != nil {
return nil,e
}
}
return rr,nil
}

@ -0,0 +1,54 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_user_manager.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
import "brbac"
type (
DUserManager struct {
provider brbac.UserProvider
repository brbac.UserRepository
}
DUserManagerFnc func (um *DUserManager) error
)
func NewDUserManager (provider brbac.UserProvider, repository brbac.UserRepository, ops ... DUserManagerFnc) (*DUserManager, error) {
um := &DUserManager {
provider : provider,
repository : repository,
}
for _,o := range ops {
if e:=o(um); e!=nil {
return nil,e
}
}
return um,nil
}

@ -0,0 +1,56 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_user_provider.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
import "brbac"
type (
DUserProvider struct {
repository brbac.UserRepository
}
DUserProviderFnc func(rp *DUserProvider) error
)
func NewDUserProvider (repository brbac.UserRepository, ops ...DUserProviderFnc) (*DUserProvider,error) {
rp := &DUserProvider{
repository: repository,
}
for _,o := range ops {
if e := o(rp); e != nil {
return nil,e
}
}
return rp,nil
}

@ -0,0 +1,51 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name d_user_repository.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac_i
type (
DUserRepository struct {
}
DUserRepositoryFnc func (rr *DUserRepository) error
)
func NewDUserRepository (ops ...DUserRepositoryFnc) (*DUserRepository,error) {
rr := &DUserRepository{}
for _,o := range ops {
if e:=o(rr); e != nil {
return nil,e
}
}
return rr,nil
}

@ -0,0 +1,3 @@
module brbac_i
go 1.22

@ -24,25 +24,35 @@
package brbac package brbac
import "rsls"
type ( type (
Role struct { Role struct {
roleID ActorID Actor
State ActorState roles Roles
Flags ActorFlags
name string
actors []ActorID
subRoles []ActorID
} }
RoleFnc func (role *Role) error
) )
func NewRole (ops ... RoleFnc) (*Role,error) {
r := &Role {}
for _,o := range ops {
if e := o(r); e != nil {
return nil,e
}
}
return r,nil
}
/*
func (r *Role) AddRole (roleID ...ActorID) error { func (r *Role) AddRole (roleID ...ActorID) error {
if len(roleID) == 0 { if len(roleID) == 0 {
return nil return nil
@ -52,7 +62,7 @@ func (r *Role) AddRole (roleID ...ActorID) error {
state := make(map[ActorID]byte) state := make(map[ActorID]byte)
for _,ri := range roleID { for _,ri := range roleID {
if ri == r.roleID { if ri == r.ID {
return G.ErrRoleCycle return G.ErrRoleCycle
} }
// Check if is RoleID // Check if is RoleID
@ -60,12 +70,12 @@ func (r *Role) AddRole (roleID ...ActorID) error {
return G.ErrInvalidIDRole return G.ErrInvalidIDRole
} }
// Check if already exists // Check if already exists
if HasActor(r.subRoles,ri) { if HasActor(r.roles,ri) {
continue continue
} }
// **Verificación de ciclo antes de agregar el rol** // **Verificación de ciclo antes de agregar el rol**
cycleResult := detectRoleCycleInHierarchy(r.roleID, ri, G.RoleProvider, &state) cycleResult := detectRoleCycleInHierarchy(r.ID, ri, &state)
if !cycleResult.IsOk() { if !cycleResult.IsOk() {
return cycleResult.Fail() return cycleResult.Fail()
} else if cycleResult.Result() { } else if cycleResult.Result() {
@ -73,10 +83,11 @@ func (r *Role) AddRole (roleID ...ActorID) error {
} }
// Agregar el rol a los subroles // Agregar el rol a los subroles
r.subRoles = append(r.subRoles, ri) r.roles = append(r.roles, ri)
} }
return nil return nil
} }
*/
@ -84,52 +95,3 @@ func (r *Role) AddRole (roleID ...ActorID) error {
func DetectRoleCycleInHierarchy(roleID, newRoleID ActorID, provider RoleProvider) rsls.RBool {
state := make(map[ActorID]byte)
return detectRoleCycleInHierarchy(roleID, newRoleID, G.RoleProvider, &state)
}
// detectRoleCycleInHierarchy realiza la verificación recursiva de si se forma un ciclo
func detectRoleCycleInHierarchy(roleID, newRoleID ActorID, provider RoleProvider, state *map[ActorID]byte) rsls.RBool {
// Si el nuevo rol ya está en la jerarquía del rol actual, entonces hemos encontrado un ciclo
if (*state)[newRoleID] == 1 {
return rsls.BoolSuccessTrue // Ciclo detectado
}
// Si el rol ha sido visitado completamente, entonces no es necesario revisarlo de nuevo
if (*state)[newRoleID] == 2 {
return rsls.BoolSuccessFalse
}
// Marcar el rol como "en proceso"
(*state)[newRoleID] = 1
// Obtener los subroles del nuevo rol
subRoles, err := provider.GetSubRoles(newRoleID)
if err != nil {
return rsls.MakeBoolError(err) // Error al obtener los subroles
}
// Realizar DFS para cada subrol del nuevo rol
for _, subRoleID := range subRoles {
if subRoleID == roleID {
// Detectar referencia directa al rol original, indicando un ciclo
return rsls.BoolSuccessTrue
}
cycleCheck := detectRoleCycleInHierarchy(roleID, subRoleID, provider, state)
if !cycleCheck.IsOk() ||cycleCheck.Result() {
return cycleCheck
}
}
// Marcar el rol como "visitado" después de procesar todos sus subroles
(*state)[newRoleID] = 2
return rsls.BoolSuccessFalse // No se ha detectado un ciclo
}

@ -0,0 +1,95 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name role_manager.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
import "rsls"
type (
RoleManager interface {
Create () (*Role,error)
Update (role *Role) error
Delete (roleID ActorID) error
DelSubRole (roleID ...ActorID) error
AddSubRole (roleID ...ActorID) error
}
)
func DetectRoleCycle(roleID, newRoleID ActorID, provider RoleProvider) rsls.RBool {
state := make(map[ActorID]byte)
return detectRoleCycle(roleID, newRoleID, provider, &state)
}
// detectRoleCycle realiza la verificación recursiva de si se forma un ciclo
func detectRoleCycle(roleID, newRoleID ActorID, provider RoleProvider, state *map[ActorID]byte) rsls.RBool {
// Si el nuevo rol ya está en la jerarquía del rol actual, entonces hemos encontrado un ciclo
if (*state)[newRoleID] == 1 {
return rsls.RBoolOkTrue // Ciclo detectado
}
// Si el rol ha sido visitado completamente, entonces no es necesario revisarlo de nuevo
if (*state)[newRoleID] == 2 {
return rsls.RBoolOkFalse
}
// Marcar el rol como "en proceso"
(*state)[newRoleID] = 1
// Obtener los subroles del nuevo rol
subRoles, err := provider.GetSubRoles(newRoleID)
if err != nil {
return rsls.MakeBoolError(err) // Error al obtener los subroles
}
// Realizar DFS para cada subrol del nuevo rol
for _, subRoleID := range subRoles {
if subRoleID == roleID {
// Detectar referencia directa al rol original, indicando un ciclo
return rsls.RBoolOkTrue
}
cycleCheck := detectRoleCycle(roleID, subRoleID, provider, state)
if !cycleCheck.IsOk() ||cycleCheck.Result() {
return cycleCheck
}
}
// Marcar el rol como "visitado" después de procesar todos sus subroles
(*state)[newRoleID] = 2
return rsls.RBoolOkFalse // No se ha detectado un ciclo
}

@ -24,14 +24,12 @@
package brbac package brbac
type ( type (
RoleProvider interface { RoleProvider interface {
//GetRole (roleID ActorID) (*Role,error) GetSubRoles (roleID ActorID) (Roles, error)
GetSubRoles(roleID ActorID) ([]ActorID,error)
} }
) )

@ -0,0 +1,33 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name role_repository.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
RoleRepository interface {
}
)

@ -0,0 +1,30 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name roles.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type Roles []ActorID

@ -40,7 +40,7 @@ func (m *MockRoleProvider) GetSubRoles(roleID ActorID) ([]ActorID, error) {
func TestAddRole(t *testing.T) { func TestAddRole(t *testing.T) {
// Crear un RoleProvider simulado con algunos roles y subroles // Crear un RoleManager simulado con algunos roles y subroles
provider := &MockRoleProvider{ provider := &MockRoleProvider{
roles: map[ActorID][]ActorID{ roles: map[ActorID][]ActorID{
@ -49,7 +49,7 @@ func TestAddRole(t *testing.T) {
0x12: {}, // El rol 0x12 no tiene subroles 0x12: {}, // El rol 0x12 no tiene subroles
}, },
} }
G.RoleProvider = provider G.RoleManager = provider
// Crear un rol inicial // Crear un rol inicial
role := &Role{ role := &Role{
@ -86,7 +86,7 @@ func TestAddRole(t *testing.T) {
} }
func TestDetectRoleCycleInHierarchy(t *testing.T) { func TestDetectRoleCycleInHierarchy(t *testing.T) {
// Crear un RoleProvider simulado con algunos roles y subroles // Crear un RoleManager simulado con algunos roles y subroles
provider := &MockRoleProvider{ provider := &MockRoleProvider{
roles: map[ActorID][]ActorID{ roles: map[ActorID][]ActorID{
0x10: {0x11, 0x12}, // El rol 0x10 tiene subroles 0x11 y 0x12 0x10: {0x11, 0x12}, // El rol 0x10 tiene subroles 0x11 y 0x12

@ -0,0 +1,39 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name session.go
// ✍️ Created by DEV
// 📅 Modified 10/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
Session interface {
Principal () *User
}
)

@ -0,0 +1,27 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name session_manager.go
// ✍️ Created by DEV
// 📅 Modified 10/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac

@ -0,0 +1,27 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name session_provider.go
// ✍️ Created by DEV
// 📅 Modified 10/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac

@ -0,0 +1,27 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name session_repository.go
// ✍️ Created by DEV
// 📅 Modified 10/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac

@ -0,0 +1,39 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name user.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
User struct {
Actor
roles Roles
}
)

@ -0,0 +1,36 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name user_manager.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
UserManager interface {
}
)

@ -0,0 +1,37 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name user_provider.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
UserProvider interface {
}
)

@ -0,0 +1,37 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name user_repository.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package brbac
type (
UserRepository interface {
}
)

@ -25,12 +25,6 @@
package rsls package rsls
const (
BoolSuccessTrue BoolSuccess = true
BoolSuccessFalse BoolSuccess = false
)
type ( type (
RBool interface { RBool interface {
@ -39,47 +33,8 @@ type (
Fail () error Fail () error
} }
BoolSuccess bool
BoolError struct {
error
}
) )
func (s BoolSuccess) IsOk () bool {
return true }
func (s BoolSuccess) Result() bool {
return bool(s) }
func (s BoolSuccess) Fail () error {
return nil }
func MakeBoolError (err error) BoolError {
return BoolError{ err }
}
func (s BoolError) IsOk () bool {
return false }
func (s BoolError) Result() bool {
return false }
func (s BoolError) Fail () error {
return s.error }

@ -0,0 +1,58 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name r_bool_error.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package rsls
type (
RBoolError struct {
error
}
)
func MakeBoolError (err error) RBoolError {
return RBoolError{err } }
func (_ RBoolError) IsOk () bool {
return false }
func (_ RBoolError) Result() bool {
return false }
func (s RBoolError) Fail () error {
return s.error }

@ -0,0 +1,49 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name r_bool_ok.go
// ✍️ Created by DEV
// 📅 Modified 09/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package rsls
const (
RBoolOkTrue RBoolOk = true
RBoolOkFalse RBoolOk = false
)
type RBoolOk bool
func (_ RBoolOk) IsOk () bool {
return true }
func (s RBoolOk) Result() bool {
return bool(s) }
func (_ RBoolOk) Fail () error {
return nil }

@ -41,7 +41,7 @@ func traditionalBoolError(input int) (bool, error) {
// Método con RBool // Método con RBool
func rboolMethod(input int) RBool { func rboolMethod(input int) RBool {
if input > 0 { if input > 0 {
return BoolSuccessTrue return RBoolOkTrue
} }
return MakeBoolError(errors.New("input must be greater than zero")) return MakeBoolError(errors.New("input must be greater than zero"))
} }

@ -5,6 +5,8 @@ use (
core core
core/errs core/errs
core/rsls core/rsls
vigil
brbac brbac
brbac/brbac_i
) )

@ -0,0 +1,196 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name active.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
import "errs"
var (
// G Public vars
G = struct {
ErrInvalidActor errs.ErrCode
} {
ErrInvalidActor : errs.ErrCode("invalid-actor-type"),
}
// g Private vars
g = struct {
actorFlags []ActorStateFlags
actorFlagNames []string
actorModeNames []string
actorTypeAtts []ActorTypeAtts
actorTypeNames []string
}{
actorFlags: []ActorStateFlags{
ActorFlagVerified,
ActorFlagRequired,
ActorFlagRestricted,
ActorFlagLimited,
ActorFlagCompromised,
},
actorFlagNames: []string {
"Verified",
"Required",
"Restricted",
"Limited",
"Compromised",
},
actorModeNames: []string{
"Active",
"Inactive",
"Pending",
"Suspended ",
"Revoked",
"Paused",
"Expired",
"Deleted",
},
actorTypeNames: []string{
"User", // 0x00
"Role", // 0x01
"Service", // 0x02
"Device", // 0x03
"Group", // 0x04
"Organization", // 0x05
"APIKey", // 0x06
"System", // 0x07
"Admin", // 0x08
"Visitor", // 0x09
"Auditor", // 0x0A
"ExternalClient", // 0x0B
"Provider", // 0x0C
"TemporaryToken", // 0x0D
"Bot", // 0x0E
"Reserved", // 0x0F
"BlockchainNode", // 0x10
"BlockchainUser", // 0x11
"SmartContract", // 0x12
"BlockchainAPI", // 0x13
"Wallet", // 0x14
"Miner", // 0x15
"Validator", // 0x16
"DApp", // 0x17
"Token", // 0x18
"BlockchainOracle", // 0x19
"BlockchainExplorer", // 0x1A
"DAO", // 0x1B
"NFT", // 0x1C
"BlockchainBridge", // 0x1D
"Staking", // 0x1E
"DefiPlatform", // 0x1F
"BlockchainWallet", // 0x20
"BlockchainExplorerAPI", // 0x21
"BlockchainTransaction", // 0x22
"BlockchainBackup", // 0x23
"SecurityModule", // 0x24
"QuantumComputer", // 0x25
"QuantumWallet", // 0x26
"AI", // 0x30
"CloudService", // 0x31
"Microservice", // 0x32
"ThirdParty", // 0x33
"ExternalSystem", // 0x34
"MobileDevice", // 0x35
"ExternalAPI", // 0x36
"Server", // 0x37
"UserAgent", // 0x38
"Container", // 0x39
"Network", // 0x3A
"EdgeDevice", // 0x3B
"VirtualMachine", // 0x3C
"Hypervisor", // 0x3D
},
actorTypeAtts: []ActorTypeAtts {
ActorTypeAttCanLogin | ActorTypeAttExclusive, // User", 0x00
0, // Role", 0x01
0, // Service", 0x02
0, // Device", 0x03
0, // Group", 0x04
0, // Organization", 0x05
0, // APIKey", 0x06
0, // System", 0x07
0, // Admin", 0x08
0, // Visitor", 0x09
0, // Auditor", 0x0A
0, // ExternalClient", 0x0B
0, // Provider", 0x0C
0, // TemporaryToken", 0x0D
0, // Bot", 0x0E
0, // Reserved", 0x0F
0, // BlockchainNode", 0x10
0, // BlockchainUser", 0x11
0, // SmartContract", 0x12
0, // BlockchainAPI", 0x13
0, // Wallet", 0x14
0, // Miner", 0x15
0, // Validator", 0x16
0, // DApp", 0x17
0, // Token", 0x18
0, // BlockchainOracle", 0x19
0, // BlockchainExplorer", 0x1A
0, // DAO", 0x1B
0, // NFT", 0x1C
0, // BlockchainBridge", 0x1D
0, // Staking", 0x1E
0, // DefiPlatform", 0x1F
0, // BlockchainWallet", 0x20
0, // BlockchainExplorerAPI", 0x21
0, // BlockchainTransaction", 0x22
0, // BlockchainBackup", 0x23
0, // SecurityModule", 0x24
0, // QuantumComputer", 0x25
0, // QuantumWallet", 0x26
0, // AI", 0x30
0, // CloudService", 0x31
0, // Microservice", 0x32
0, // ThirdParty", 0x33
0, // ExternalSystem", 0x34
0, // MobileDevice", 0x35
0, // ExternalAPI", 0x36
0, // Server", 0x37
0, // UserAgent", 0x38
0, // Container", 0x39
0, // Network", 0x3A
0, // EdgeDevice", 0x3B
0, // VirtualMachine", 0x3C
0, // Hypervisor", 0x3D
},
}
)

@ -0,0 +1,52 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_id.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
type ActorID uint64
// GetActorType extrae los 6 bits más significativos para determinar el tipo de Actor.
func (a ActorID) GetActorType() ActorType {
// Desplazar el ActorID 58 bits a la derecha para que los 6 bits más significativos estén al inicio,
// y luego convertirlos en un ActorType.
return ActorType(a >> 58) // Extraemos los 6 bits más significativos
}
// SetActorType establece los 6 bits más significativos como el tipo de Actor.
func (a ActorID) SetActorType(actorType ActorType) ActorID {
// Verificar que el tipo está dentro del rango de 6 bits (0-63).
if actorType > 0x3F { // 0x3F es 63 en decimal, el rango de 6 bits
panic(G.ErrInvalidActor)
}
// Establecer el nuevo tipo en los 6 bits más significativos.
return ActorID((a &^ (ActorID(0x3F) << 58)) | (ActorID(actorType) << 58))
}

@ -0,0 +1,49 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_mode.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
const (
// Modo (primeros 4 bits)
ActorModeActive ActorMode = 0b000 // El usuario está activo y no tiene restricciones
ActorModeInactive ActorMode = 0b001 // El usuario está inactivo y temporalmente deshabilitado
ActorModePending ActorMode = 0b010 // El usuario está pendiente de activación (por ejemplo, verificación de correo electrónico)
ActorModeSuspended ActorMode = 0b011 // El usuario está suspendido debido a problemas de seguridad o políticas
ActorModeRevoked ActorMode = 0b100 // El acceso del usuario ha sido revocado permanentemente
ActorModePaused ActorMode = 0b101 // El usuario ha pausado su cuenta (puede reactivarse)
ActorModeExpired ActorMode = 0b110 // La cuenta del usuario ha expirado (por ejemplo, acceso temporal)
ActorModeDeleted ActorMode = 0b111 // La cuenta del usuario está eliminada y ya no existe
)
type ActorMode uint8

@ -0,0 +1,75 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_state.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
import "math/bits"
const (
modeBits = 4
modeMask ActorState = 0b1111
)
type ActorState uint16
func (s ActorState) GetMode() ActorMode {
return ActorMode(s & modeMask) }
func (s ActorState) SetMode(state ActorMode) ActorState {
return (s &^ modeMask) | (ActorState(state) & modeMask) }
func (s ActorState) HasFlag (flag ActorStateFlags) bool {
return s & ActorState(flag) != 0 }
func (s ActorState) SetFlag (flag ActorStateFlags) ActorState {
return (s &^ modeMask) | ((s | ActorState(flag)) &^ modeMask) }
func (s ActorState) DelFlag (flag ActorStateFlags) ActorState {
return (s &^ modeMask) | ((s &^ ActorState(flag)) &^ modeMask) }
func (s ActorState) ClearFlags () ActorState {
return s & modeMask }
func (s ActorState) Count() int {
return bits.OnesCount16(uint16(s) >> modeBits) }
func (s ActorState) Flags() []ActorStateFlags {
var flags []ActorStateFlags
for _, flag := range g.actorFlags {
if s.HasFlag(flag) {
flags = append(flags, flag)
}
}
return flags
}

@ -0,0 +1,41 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_state_flags.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
const (
// Flags (últimos 16 - modeBits )
_ ActorStateFlags = iota
ActorFlagVerified ActorStateFlags = 1 << (modeBits + iota - 1)
ActorFlagRequired
ActorFlagRestricted
ActorFlagLimited
ActorFlagCompromised
)
type ActorStateFlags uint16

@ -0,0 +1,104 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_type.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
// Definición de los valores posibles para ActorType (64 tipos con 8 bits).
const (
// Tipos Generales
ActorTypeUser ActorType = iota
ActorTypeRole // Rol
ActorTypeService // Servicio
ActorTypeDevice // Dispositivo (IoT, hardware)
ActorTypeGroup // Grupo
ActorTypeOrganization // Organización
ActorTypeAPIKey // API Key
ActorTypeSystem // Sistema interno
ActorTypeAdmin // Administrador
ActorTypeVisitor // Visitante
ActorTypeAuditor // Auditor
ActorTypeExternalClient // Cliente Externo
ActorTypeProvider // Proveedor
ActorTypeTemporaryToken // Token Temporal
ActorTypeBot // Bot o script
ActorTypeReserved // Reservado para futuras expansiones
// Tipos Relacionados con Blockc
ActorTypeBlockchainNode // Nodo de blockchain
ActorTypeBlockchainUser // Usuario de blockchain
ActorTypeSmartContract // Contrato inteligente (smart contract)
ActorTypeBlockchainAPI // API de blockchain
ActorTypeWallet // Billetera (wallet) de blockchain
ActorTypeMiner // Minero de blockchain
ActorTypeValidator // Validador de transacciones o bloques
ActorTypeDApp // Aplicación descentralizada (DApp)
ActorTypeToken // Token o criptomoneda
ActorTypeBlockchainOracle // Oráculo de blockchain (proveedor de datos externos)
ActorTypeBlockchainExplorer // Explorador de blockchain
ActorTypeDAO // Organización Autónoma Descentralizada (DAO)
ActorTypeNFT // Token No Fungible (NFT)
ActorTypeBlockchainBridge // Puente entre blockchains
ActorTypeStaking // Participante en staking
ActorTypeDefiPlatform // Plataforma de Finanzas Descentralizadas (DeFi)
ActorTypeBlockchainWallet // Billetera específica de blockchain
ActorTypeBlockchainExplorerAPI // API para exploradores de blockchain
ActorTypeBlockchainTransaction // Transacción de blockchain
ActorTypeBlockchainBackup // Copia de seguridad o servicio de respaldo de blockchain
ActorTypeSecurityModule // Módulo de seguridad de blockchain
ActorTypeQuantumComputer // Computadora cuántica (relacionada con blockchain)
ActorTypeQuantumWallet // Billetera cuántica (relacionada con blockchain)
// Otros Tipos
ActorTypeAI // Actor basado en inteligencia artificial
ActorTypeCloudService // Servicio en la nube
ActorTypeMicroservice // Microservicio
ActorTypeThirdParty // Actor externo o tercero
ActorTypeExternalSystem // Sistema Externo
ActorTypeMobileDevice // Dispositivo móvil
ActorTypeExternalAPI // API externa
ActorTypeServer // Servidor físico o virtual
ActorTypeUserAgent // Agente de usuario (navegador, app, etc.)
ActorTypeContainer // Contenedor (Docker, etc.)
ActorTypeNetwork // Red o infraestructura de red
ActorTypeEdgeDevice // Dispositivo en la periferia de la red
ActorTypeVirtualMachine // Máquina virtual
ActorTypeHypervisor // Hypervisor o administrador de máquinas virtuales
)
type ActorType uint8
func (a ActorType) Name () string {
i := int(a)
if i < len(g.actorTypeNames) {
return g.actorTypeNames[i]
}
return ""
}

@ -0,0 +1,45 @@
// ------------------------------------------------------------------------
// 🚀 Project Active8
// 🔗 Active Thing (activething.com) git.activething.com/go
//
// File name actor_type_atts.go
// ✍️ Created by DEV
// 📅 Modified 11/12/2024
//
// 🔒 Copyright 2024 activething.com
//
// 📜 LICENSE --------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package vigil
const (
ActorTypeAttCanLogin ActorTypeAtts =1 << iota
ActorTypeAttExclusive
ActorTypeAttSameTypes
ActorTypeAttNotSameTypes
)
type ActorTypeAtts uint8

@ -0,0 +1,3 @@
module vigil
go 1.22
Loading…
Cancel
Save

Powered by TurnKey Linux.